Skip to content

Commit c9da957

Browse files
committed
v2.15.13
1 parent 17e1f44 commit c9da957

35 files changed

+764
-118
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Jira.js changelog
22

3+
### 2.15.13
4+
5+
- Version 2, 3:
6+
- `getResolutions` in `IssueResolution` was deprecated.
7+
- `getResolution` in `IssueResolution` was deprecated.
8+
- `createResolution` method added to `IssueResolution`.
9+
- `setDefaultResolution` method added to `IssueResolution`.
10+
- `moveResolutions` method added to `IssueResolution`.
11+
- `searchResolutions` method added to `IssueResolution`.
12+
- `updateResolution` method added to `IssueResolution`.
13+
- `deleteResolution` method added to `IssueResolution`.
14+
315
### 2.15.12
416

517
- Version 2, 3:
@@ -58,7 +70,7 @@ Version 3: maxContentLength was increased for attachments upload. Thanks to [Rea
5870

5971
### 2.15.2
6072

61-
- `isAxiosError` detecting mechanism improved. Thanks [Stephane Moser](https://github.com/Moser-ss) for the report.
73+
- `isAxiosError` detecting mechanism improved. Thanks to [Stephane Moser](https://github.com/Moser-ss) for the report.
6274

6375
### 2.15.1
6476

package-lock.json

+91-91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jira.js",
3-
"version": "2.15.12",
3+
"version": "2.15.13",
44
"description": "jira.js is a powerful Node.JS/Browser module that allows you to interact with the Jira API very easily",
55
"main": "out/index.js",
66
"types": "out/index.d.ts",
@@ -53,11 +53,11 @@
5353
"devDependencies": {
5454
"@swc-node/register": "^1.5.4",
5555
"@types/express": "^4.17.14",
56-
"@types/node": "^18.11.4",
56+
"@types/node": "^18.11.5",
5757
"@types/oauth": "^0.9.1",
5858
"@types/sinon": "^10.0.13",
59-
"@typescript-eslint/eslint-plugin": "^5.40.1",
60-
"@typescript-eslint/parser": "^5.40.1",
59+
"@typescript-eslint/eslint-plugin": "^5.41.0",
60+
"@typescript-eslint/parser": "^5.41.0",
6161
"ava": "^5.0.1",
6262
"dotenv": "^16.0.3",
6363
"eslint": "^8.26.0",

src/version2/issueResolutions.ts

+225-10
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ export class IssueResolutions {
88
constructor(private client: Client) {}
99

1010
/**
11-
* Returns a list of all issue resolution values.
11+
* @deprecated Returns a list of all issue resolution values.
1212
*
13-
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
14-
* Permission to access Jira.
13+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
14+
* Permission to access Jira.
1515
*/
1616
async getResolutions<T = Models.Resolution[]>(callback: Callback<T>): Promise<void>;
1717
/**
18-
* Returns a list of all issue resolution values.
18+
* @deprecated Returns a list of all issue resolution values.
1919
*
20-
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
21-
* Permission to access Jira.
20+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
21+
* Permission to access Jira.
2222
*/
2323
async getResolutions<T = Models.Resolution[]>(callback?: never): Promise<T>;
2424
async getResolutions<T = Models.Resolution[]>(callback?: Callback<T>): Promise<void | T> {
@@ -31,21 +31,162 @@ export class IssueResolutions {
3131
}
3232

3333
/**
34-
* Returns an issue resolution value.
34+
* Creates an issue resolution.
35+
*
36+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
37+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
38+
*/
39+
async createResolution<T = Models.ResolutionId>(
40+
parameters: Parameters.CreateResolution,
41+
callback: Callback<T>
42+
): Promise<void>;
43+
/**
44+
* Creates an issue resolution.
45+
*
46+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
47+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
48+
*/
49+
async createResolution<T = Models.ResolutionId>(
50+
parameters: Parameters.CreateResolution,
51+
callback?: never
52+
): Promise<T>;
53+
async createResolution<T = Models.ResolutionId>(
54+
parameters: Parameters.CreateResolution,
55+
callback?: Callback<T>,
56+
): Promise<void | T> {
57+
const config: RequestConfig = {
58+
url: '/rest/api/2/resolution',
59+
method: 'POST',
60+
data: parameters,
61+
};
62+
63+
return this.client.sendRequest(config, callback);
64+
}
65+
66+
/**
67+
* Sets default issue resolution.
68+
*
69+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
70+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
71+
*/
72+
async setDefaultResolution<T = void>(
73+
parameters: Parameters.SetDefaultResolution,
74+
callback: Callback<T>
75+
): Promise<void>;
76+
/**
77+
* Sets default issue resolution.
78+
*
79+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
80+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
81+
*/
82+
async setDefaultResolution<T = void>(parameters: Parameters.SetDefaultResolution, callback?: never): Promise<T>;
83+
async setDefaultResolution<T = void>(
84+
parameters: Parameters.SetDefaultResolution,
85+
callback?: Callback<T>,
86+
): Promise<void | T> {
87+
const config: RequestConfig = {
88+
url: '/rest/api/2/resolution/default',
89+
method: 'PUT',
90+
data: {
91+
id: parameters.id,
92+
},
93+
};
94+
95+
return this.client.sendRequest(config, callback);
96+
}
97+
98+
/**
99+
* Changes the order of issue resolutions.
100+
*
101+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
102+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
103+
*/
104+
async moveResolutions<T = void>(parameters: Parameters.MoveResolutions, callback: Callback<T>): Promise<void>;
105+
/**
106+
* Changes the order of issue resolutions.
107+
*
108+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
109+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
110+
*/
111+
async moveResolutions<T = void>(parameters: Parameters.MoveResolutions, callback?: never): Promise<T>;
112+
async moveResolutions<T = void>(parameters: Parameters.MoveResolutions, callback?: Callback<T>): Promise<void | T> {
113+
const config: RequestConfig = {
114+
url: '/rest/api/2/resolution/move',
115+
method: 'PUT',
116+
data: {
117+
ids: parameters.ids,
118+
after: parameters.after,
119+
position: parameters.position,
120+
},
121+
};
122+
123+
return this.client.sendRequest(config, callback);
124+
}
125+
126+
/**
127+
* Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of
128+
* resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria:
129+
*
130+
* - A list of resolutions IDs.
131+
* - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects
132+
* only, as there is no concept of default resolutions in team-managed projects.
35133
*
36134
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
37135
* Permission to access Jira.
38136
*/
39-
async getResolution<T = Models.Resolution>(
40-
parameters: Parameters.GetResolution,
137+
async searchResolutions<T = Models.PageResolution>(
138+
parameters: Parameters.SearchResolutions | undefined,
41139
callback: Callback<T>
42140
): Promise<void>;
43141
/**
44-
* Returns an issue resolution value.
142+
* Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of
143+
* resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria:
144+
*
145+
* - A list of resolutions IDs.
146+
* - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects
147+
* only, as there is no concept of default resolutions in team-managed projects.
45148
*
46149
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
47150
* Permission to access Jira.
48151
*/
152+
async searchResolutions<T = Models.PageResolution>(
153+
parameters?: Parameters.SearchResolutions,
154+
callback?: never
155+
): Promise<T>;
156+
async searchResolutions<T = Models.PageResolution>(
157+
parameters?: Parameters.SearchResolutions,
158+
callback?: Callback<T>,
159+
): Promise<void | T> {
160+
const config: RequestConfig = {
161+
url: '/rest/api/2/resolution/search',
162+
method: 'GET',
163+
params: {
164+
startAt: parameters?.startAt,
165+
maxResults: parameters?.maxResults,
166+
id: parameters?.id,
167+
onlyDefault: parameters?.onlyDefault,
168+
},
169+
};
170+
171+
return this.client.sendRequest(config, callback);
172+
}
173+
174+
/**
175+
* @deprecated Returns an issue resolution value.
176+
*
177+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
178+
* Permission to access Jira.
179+
*/
180+
async getResolution<T = Models.Resolution>(
181+
parameters: Parameters.GetResolution,
182+
callback: Callback<T>
183+
): Promise<void>;
184+
/**
185+
* @deprecated Returns an issue resolution value.
186+
*
187+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
188+
* Permission to access Jira.
189+
*/
49190
async getResolution<T = Models.Resolution>(parameters: Parameters.GetResolution, callback?: never): Promise<T>;
50191
async getResolution<T = Models.Resolution>(
51192
parameters: Parameters.GetResolution,
@@ -58,4 +199,78 @@ export class IssueResolutions {
58199

59200
return this.client.sendRequest(config, callback);
60201
}
202+
203+
/**
204+
* Updates an issue resolution.
205+
*
206+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
207+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
208+
*/
209+
async updateResolution<T = void>(parameters: Parameters.UpdateResolution, callback: Callback<T>): Promise<void>;
210+
/**
211+
* Updates an issue resolution.
212+
*
213+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
214+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
215+
*/
216+
async updateResolution<T = void>(parameters: Parameters.UpdateResolution, callback?: never): Promise<T>;
217+
async updateResolution<T = void>(parameters: Parameters.UpdateResolution, callback?: Callback<T>): Promise<void | T> {
218+
const config: RequestConfig = {
219+
url: `/rest/api/2/resolution/${parameters.id}`,
220+
method: 'PUT',
221+
data: {
222+
...parameters,
223+
name: parameters.name,
224+
description: parameters.description,
225+
id: undefined,
226+
},
227+
};
228+
229+
return this.client.sendRequest(config, callback);
230+
}
231+
232+
/**
233+
* Deletes an issue resolution.
234+
*
235+
* This operation is
236+
* [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the
237+
* `location` link in the response to determine the status of the task and use [Get
238+
* task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates.
239+
*
240+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
241+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
242+
*/
243+
async deleteResolution<T = Models.TaskProgressObject>(
244+
parameters: Parameters.DeleteResolution,
245+
callback: Callback<T>
246+
): Promise<void>;
247+
/**
248+
* Deletes an issue resolution.
249+
*
250+
* This operation is
251+
* [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the
252+
* `location` link in the response to determine the status of the task and use [Get
253+
* task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates.
254+
*
255+
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
256+
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
257+
*/
258+
async deleteResolution<T = Models.TaskProgressObject>(
259+
parameters: Parameters.DeleteResolution,
260+
callback?: never
261+
): Promise<T>;
262+
async deleteResolution<T = Models.TaskProgressObject>(
263+
parameters: Parameters.DeleteResolution,
264+
callback?: Callback<T>,
265+
): Promise<void | T> {
266+
const config: RequestConfig = {
267+
url: `/rest/api/2/resolution/${parameters.id}`,
268+
method: 'DELETE',
269+
params: {
270+
replaceWith: parameters.replaceWith,
271+
},
272+
};
273+
274+
return this.client.sendRequest(config, callback);
275+
}
61276
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** Details of an issue resolution. */
2+
export interface CreateResolutionDetails {
3+
/** The name of the resolution. Must be unique (case-insensitive). */
4+
name: string;
5+
/** The description of the resolution. */
6+
description?: string;
7+
}

src/version2/models/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export * from './createdIssues';
6666
export * from './createIssueAdjustmentDetails';
6767
export * from './createPriorityDetails';
6868
export * from './createProjectDetails';
69+
export * from './createResolutionDetails';
6970
export * from './createUiModificationDetails';
7071
export * from './createUpdateRoleRequest';
7172
export * from './createWorkflowCondition';
@@ -315,6 +316,7 @@ export * from './pageOfWorklogs';
315316
export * from './pagePriority';
316317
export * from './pageProject';
317318
export * from './pageProjectDetails';
319+
export * from './pageResolution';
318320
export * from './pageScreen';
319321
export * from './pageScreenScheme';
320322
export * from './pageScreenWithTab';
@@ -383,7 +385,9 @@ export * from './removeOptionFromIssuesResult';
383385
export * from './renamedCascadingOption';
384386
export * from './renamedOption';
385387
export * from './reorderIssuePriorities';
388+
export * from './reorderIssueResolutionsRequest';
386389
export * from './resolution';
390+
export * from './resolutionId';
387391
export * from './restrictedPermission';
388392
export * from './richText';
389393
export * from './roleActor';
@@ -409,6 +413,7 @@ export * from './securityScheme';
409413
export * from './securitySchemes';
410414
export * from './serverInformation';
411415
export * from './setDefaultPriorityRequest';
416+
export * from './setDefaultResolutionRequest';
412417
export * from './sharePermission';
413418
export * from './sharePermissionInput';
414419
export * from './simpleApplicationProperty';
@@ -449,6 +454,7 @@ export * from './updateFieldConfigurationSchemeDetails';
449454
export * from './updateIssueAdjustmentDetails';
450455
export * from './updatePriorityDetails';
451456
export * from './updateProjectDetails';
457+
export * from './updateResolutionDetails';
452458
export * from './updateScreenDetails';
453459
export * from './updateScreenSchemeDetails';
454460
export * from './updateScreenTypes';

src/version2/models/pageResolution.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Resolution } from './resolution';
2+
3+
/** A page of items. */
4+
export interface PageResolution {
5+
/** The URL of the page. */
6+
self?: string;
7+
/** If there is another page of results, the URL of the next page. */
8+
nextPage?: string;
9+
/** The maximum number of items that could be returned. */
10+
maxResults?: number;
11+
/** The index of the first item returned. */
12+
startAt?: number;
13+
/** The number of items returned. */
14+
total?: number;
15+
/** Whether this is the last page. */
16+
isLast?: boolean;
17+
/** The list of items. */
18+
values?: Resolution[];
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** Change the order of issue resolutions. */
2+
export interface ReorderIssueResolutionsRequest {
3+
/** The list of resolution IDs to be reordered. Cannot contain duplicates nor after ID. */
4+
ids: string[];
5+
/** The ID of the resolution. Required if `position` isn't provided. */
6+
after?: string;
7+
/** The position for issue resolutions to be moved to. Required if `after` isn't provided. */
8+
position?: string;
9+
}

0 commit comments

Comments
 (0)