@resolution/jira-api-client 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +10 -3
  3. package/.eslintrc.js +0 -3
  4. package/config/api-typescript-generator.config.ts +0 -91
  5. package/config/compare-schemas.ts +0 -307
  6. package/src/index.ts +0 -47
  7. package/src/openapi/platform/base-jira-platform-api-client.ts +0 -2298
  8. package/src/openapi/platform/core/common-http-client.ts +0 -723
  9. package/src/openapi/platform/core/common-http-service.ts +0 -22
  10. package/src/openapi/platform/core/common-validation-schema-storage.ts +0 -105
  11. package/src/openapi/platform/models/announcement-banner.ts +0 -59
  12. package/src/openapi/platform/models/app-data-policies.ts +0 -79
  13. package/src/openapi/platform/models/app-migration.ts +0 -172
  14. package/src/openapi/platform/models/app-properties.ts +0 -32
  15. package/src/openapi/platform/models/audit-records.ts +0 -140
  16. package/src/openapi/platform/models/avatars.ts +0 -48
  17. package/src/openapi/platform/models/classification-levels.ts +0 -58
  18. package/src/openapi/platform/models/common.ts +0 -2669
  19. package/src/openapi/platform/models/dashboards.ts +0 -849
  20. package/src/openapi/platform/models/dynamic-modules.ts +0 -121
  21. package/src/openapi/platform/models/filter-sharing.ts +0 -103
  22. package/src/openapi/platform/models/filters.ts +0 -319
  23. package/src/openapi/platform/models/group-and-user-picker.ts +0 -85
  24. package/src/openapi/platform/models/groups.ts +0 -247
  25. package/src/openapi/platform/models/issue-attachments.ts +0 -290
  26. package/src/openapi/platform/models/issue-comment-properties.ts +0 -27
  27. package/src/openapi/platform/models/issue-comments.ts +0 -91
  28. package/src/openapi/platform/models/issue-custom-field-configuration-apps.ts +0 -96
  29. package/src/openapi/platform/models/issue-custom-field-contexts.ts +0 -1072
  30. package/src/openapi/platform/models/issue-custom-field-options-apps.ts +0 -273
  31. package/src/openapi/platform/models/issue-custom-field-options.ts +0 -283
  32. package/src/openapi/platform/models/issue-custom-field-values-apps.ts +0 -118
  33. package/src/openapi/platform/models/issue-field-configurations.ts +0 -435
  34. package/src/openapi/platform/models/issue-fields.ts +0 -392
  35. package/src/openapi/platform/models/issue-link-types.ts +0 -28
  36. package/src/openapi/platform/models/issue-links.ts +0 -185
  37. package/src/openapi/platform/models/issue-notification-schemes.ts +0 -370
  38. package/src/openapi/platform/models/issue-priorities.ts +0 -196
  39. package/src/openapi/platform/models/issue-properties.ts +0 -259
  40. package/src/openapi/platform/models/issue-remote-links.ts +0 -207
  41. package/src/openapi/platform/models/issue-resolutions.ts +0 -180
  42. package/src/openapi/platform/models/issue-search.ts +0 -367
  43. package/src/openapi/platform/models/issue-security-level.ts +0 -76
  44. package/src/openapi/platform/models/issue-security-schemes.ts +0 -496
  45. package/src/openapi/platform/models/issue-type-schemes.ts +0 -290
  46. package/src/openapi/platform/models/issue-type-screen-schemes.ts +0 -286
  47. package/src/openapi/platform/models/issue-types.ts +0 -66
  48. package/src/openapi/platform/models/issue-votes.ts +0 -38
  49. package/src/openapi/platform/models/issue-watchers.ts +0 -67
  50. package/src/openapi/platform/models/issue-worklogs.ts +0 -190
  51. package/src/openapi/platform/models/issues.ts +0 -1268
  52. package/src/openapi/platform/models/jira-expressions.ts +0 -578
  53. package/src/openapi/platform/models/jira-settings.ts +0 -118
  54. package/src/openapi/platform/models/jql-functions-apps.ts +0 -128
  55. package/src/openapi/platform/models/jql.ts +0 -783
  56. package/src/openapi/platform/models/labels.ts +0 -42
  57. package/src/openapi/platform/models/license-metrics.ts +0 -68
  58. package/src/openapi/platform/models/myself.ts +0 -29
  59. package/src/openapi/platform/models/permission-schemes.ts +0 -89
  60. package/src/openapi/platform/models/permissions.ts +0 -308
  61. package/src/openapi/platform/models/priority-schemes.ts +0 -527
  62. package/src/openapi/platform/models/project-avatars.ts +0 -29
  63. package/src/openapi/platform/models/project-classification-levels.ts +0 -24
  64. package/src/openapi/platform/models/project-components.ts +0 -231
  65. package/src/openapi/platform/models/project-email.ts +0 -27
  66. package/src/openapi/platform/models/project-features.ts +0 -78
  67. package/src/openapi/platform/models/project-permission-schemes.ts +0 -43
  68. package/src/openapi/platform/models/project-role-actors.ts +0 -107
  69. package/src/openapi/platform/models/project-roles.ts +0 -76
  70. package/src/openapi/platform/models/project-types.ts +0 -36
  71. package/src/openapi/platform/models/project-versions.ts +0 -216
  72. package/src/openapi/platform/models/projects.ts +0 -429
  73. package/src/openapi/platform/models/screen-schemes.ts +0 -192
  74. package/src/openapi/platform/models/screen-tab-fields.ts +0 -45
  75. package/src/openapi/platform/models/screens.ts +0 -171
  76. package/src/openapi/platform/models/server-info.ts +0 -100
  77. package/src/openapi/platform/models/service-registry.ts +0 -68
  78. package/src/openapi/platform/models/status.ts +0 -229
  79. package/src/openapi/platform/models/time-tracking.ts +0 -38
  80. package/src/openapi/platform/models/ui-modifications-apps.ts +0 -229
  81. package/src/openapi/platform/models/user-search.ts +0 -69
  82. package/src/openapi/platform/models/users.ts +0 -121
  83. package/src/openapi/platform/models/webhooks.ts +0 -307
  84. package/src/openapi/platform/models/workflow-scheme-drafts.ts +0 -58
  85. package/src/openapi/platform/models/workflow-scheme-project-associations.ts +0 -68
  86. package/src/openapi/platform/models/workflow-schemes.ts +0 -545
  87. package/src/openapi/platform/models/workflow-transition-properties.ts +0 -33
  88. package/src/openapi/platform/models/workflow-transition-rules.ts +0 -261
  89. package/src/openapi/platform/models/workflows.ts +0 -1943
  90. package/src/openapi/platform/services/announcement-banner-service.ts +0 -142
  91. package/src/openapi/platform/services/app-data-policies-service.ts +0 -136
  92. package/src/openapi/platform/services/app-migration-service.ts +0 -289
  93. package/src/openapi/platform/services/app-properties-service.ts +0 -441
  94. package/src/openapi/platform/services/application-roles-service.ts +0 -247
  95. package/src/openapi/platform/services/audit-records-service.ts +0 -164
  96. package/src/openapi/platform/services/avatars-service.ts +0 -769
  97. package/src/openapi/platform/services/classification-levels-service.ts +0 -131
  98. package/src/openapi/platform/services/dashboards-service.ts +0 -1721
  99. package/src/openapi/platform/services/dynamic-modules-service.ts +0 -127
  100. package/src/openapi/platform/services/filter-sharing-service.ts +0 -687
  101. package/src/openapi/platform/services/filters-service.ts +0 -1901
  102. package/src/openapi/platform/services/group-and-user-picker-service.ts +0 -224
  103. package/src/openapi/platform/services/groups-service.ts +0 -751
  104. package/src/openapi/platform/services/issue-attachments-service.ts +0 -900
  105. package/src/openapi/platform/services/issue-comment-properties-service.ts +0 -324
  106. package/src/openapi/platform/services/issue-comments-service.ts +0 -812
  107. package/src/openapi/platform/services/issue-custom-field-configuration-apps-service.ts +0 -277
  108. package/src/openapi/platform/services/issue-custom-field-contexts-service.ts +0 -1339
  109. package/src/openapi/platform/services/issue-custom-field-options-apps-service.ts +0 -994
  110. package/src/openapi/platform/services/issue-custom-field-options-service.ts +0 -651
  111. package/src/openapi/platform/services/issue-custom-field-values-apps-service.ts +0 -201
  112. package/src/openapi/platform/services/issue-field-configurations-service.ts +0 -1294
  113. package/src/openapi/platform/services/issue-fields-service.ts +0 -837
  114. package/src/openapi/platform/services/issue-link-types-service.ts +0 -360
  115. package/src/openapi/platform/services/issue-links-service.ts +0 -345
  116. package/src/openapi/platform/services/issue-navigator-settings-service.ts +0 -119
  117. package/src/openapi/platform/services/issue-notification-schemes-service.ts +0 -1209
  118. package/src/openapi/platform/services/issue-priorities-service.ts +0 -575
  119. package/src/openapi/platform/services/issue-properties-service.ts +0 -606
  120. package/src/openapi/platform/services/issue-remote-links-service.ts +0 -597
  121. package/src/openapi/platform/services/issue-resolutions-service.ts +0 -534
  122. package/src/openapi/platform/services/issue-search-service.ts +0 -1139
  123. package/src/openapi/platform/services/issue-security-level-service.ts +0 -250
  124. package/src/openapi/platform/services/issue-security-schemes-service.ts +0 -1240
  125. package/src/openapi/platform/services/issue-type-properties-service.ts +0 -325
  126. package/src/openapi/platform/services/issue-type-schemes-service.ts +0 -940
  127. package/src/openapi/platform/services/issue-type-screen-schemes-service.ts +0 -994
  128. package/src/openapi/platform/services/issue-types-service.ts +0 -679
  129. package/src/openapi/platform/services/issue-votes-service.ts +0 -221
  130. package/src/openapi/platform/services/issue-watchers-service.ts +0 -331
  131. package/src/openapi/platform/services/issue-worklog-properties-service.ts +0 -348
  132. package/src/openapi/platform/services/issue-worklogs-service.ts +0 -1089
  133. package/src/openapi/platform/services/issues-service.ts +0 -3346
  134. package/src/openapi/platform/services/jira-expressions-service.ts +0 -407
  135. package/src/openapi/platform/services/jira-settings-service.ts +0 -415
  136. package/src/openapi/platform/services/jql-functions-apps-service.ts +0 -219
  137. package/src/openapi/platform/services/jql-service.ts +0 -896
  138. package/src/openapi/platform/services/labels-service.ts +0 -89
  139. package/src/openapi/platform/services/license-metrics-service.ts +0 -216
  140. package/src/openapi/platform/services/myself-service.ts +0 -520
  141. package/src/openapi/platform/services/permission-schemes-service.ts +0 -926
  142. package/src/openapi/platform/services/permissions-service.ts +0 -407
  143. package/src/openapi/platform/services/priority-schemes-service.ts +0 -1001
  144. package/src/openapi/platform/services/project-avatars-service.ts +0 -341
  145. package/src/openapi/platform/services/project-categories-service.ts +0 -318
  146. package/src/openapi/platform/services/project-classification-levels-service.ts +0 -232
  147. package/src/openapi/platform/services/project-components-service.ts +0 -1332
  148. package/src/openapi/platform/services/project-email-service.ts +0 -161
  149. package/src/openapi/platform/services/project-features-service.ts +0 -207
  150. package/src/openapi/platform/services/project-key-and-name-validation-service.ts +0 -200
  151. package/src/openapi/platform/services/project-permission-schemes-service.ts +0 -384
  152. package/src/openapi/platform/services/project-properties-service.ts +0 -320
  153. package/src/openapi/platform/services/project-role-actors-service.ts +0 -627
  154. package/src/openapi/platform/services/project-roles-service.ts +0 -867
  155. package/src/openapi/platform/services/project-types-service.ts +0 -297
  156. package/src/openapi/platform/services/project-versions-service.ts +0 -1287
  157. package/src/openapi/platform/services/projects-service.ts +0 -2196
  158. package/src/openapi/platform/services/screen-schemes-service.ts +0 -334
  159. package/src/openapi/platform/services/screen-tab-fields-service.ts +0 -276
  160. package/src/openapi/platform/services/screen-tabs-service.ts +0 -421
  161. package/src/openapi/platform/services/screens-service.ts +0 -528
  162. package/src/openapi/platform/services/server-info-service.ts +0 -88
  163. package/src/openapi/platform/services/service-registry-service.ts +0 -89
  164. package/src/openapi/platform/services/status-service.ts +0 -498
  165. package/src/openapi/platform/services/tasks-service.ts +0 -159
  166. package/src/openapi/platform/services/time-tracking-service.ts +0 -386
  167. package/src/openapi/platform/services/ui-modifications-apps-service.ts +0 -403
  168. package/src/openapi/platform/services/user-properties-service.ts +0 -413
  169. package/src/openapi/platform/services/user-search-service.ts +0 -1214
  170. package/src/openapi/platform/services/users-service.ts +0 -1108
  171. package/src/openapi/platform/services/webhooks-service.ts +0 -458
  172. package/src/openapi/platform/services/workflow-scheme-drafts-service.ts +0 -1313
  173. package/src/openapi/platform/services/workflow-scheme-project-associations-service.ts +0 -189
  174. package/src/openapi/platform/services/workflow-schemes-service.ts +0 -1617
  175. package/src/openapi/platform/services/workflow-status-categories-service.ts +0 -151
  176. package/src/openapi/platform/services/workflow-statuses-service.ts +0 -176
  177. package/src/openapi/platform/services/workflow-transition-properties-service.ts +0 -388
  178. package/src/openapi/platform/services/workflow-transition-rules-service.ts +0 -485
  179. package/src/openapi/platform/services/workflows-service.ts +0 -3477
  180. package/src/openapi/platform/validation-schema-storage.ts +0 -186
  181. package/src/openapi/software/base-jira-software-api-client.ts +0 -447
  182. package/src/openapi/software/core/common-http-client.ts +0 -723
  183. package/src/openapi/software/core/common-http-service.ts +0 -22
  184. package/src/openapi/software/core/common-validation-schema-storage.ts +0 -105
  185. package/src/openapi/software/models/board.ts +0 -918
  186. package/src/openapi/software/services/backlog-service.ts +0 -160
  187. package/src/openapi/software/services/board-service.ts +0 -4189
  188. package/src/openapi/software/services/builds-service.ts +0 -571
  189. package/src/openapi/software/services/deployments-service.ts +0 -403
  190. package/src/openapi/software/services/dev-ops-components-service.ts +0 -371
  191. package/src/openapi/software/services/development-information-service.ts +0 -2357
  192. package/src/openapi/software/services/epic-service.ts +0 -854
  193. package/src/openapi/software/services/feature-flags-service.ts +0 -303
  194. package/src/openapi/software/services/issue-service.ts +0 -529
  195. package/src/openapi/software/services/operations-service.ts +0 -741
  196. package/src/openapi/software/services/remote-links-service.ts +0 -653
  197. package/src/openapi/software/services/security-information-service.ts +0 -495
  198. package/src/openapi/software/services/sprint-service.ts +0 -969
  199. package/src/openapi/software/validation-schema-storage.ts +0 -186
  200. package/tsconfig.build.json +0 -7
  201. package/tsconfig.json +0 -4
@@ -1,1617 +0,0 @@
1
- // DO NOT EDIT!
2
- // This file is generated by "api-typescript-generator".
3
- // To update this file run "yarn build:openapi".
4
- import { z } from "zod";
5
-
6
- import * as commonHttpClient from "../core/common-http-client";
7
- import { CommonHttpService } from "../core/common-http-service";
8
- import {
9
- type DefaultWorkflow,
10
- type IssueTypesWorkflowMapping,
11
- type IssueTypeWorkflowMapping,
12
- registerCommonValidationSchemas,
13
- type WorkflowScheme,
14
- } from "../models/common";
15
- import {
16
- type PageBeanWorkflowScheme,
17
- registerWorkflowSchemesValidationSchemas,
18
- type WorkflowSchemeReadRequest,
19
- type WorkflowSchemeReadResponse,
20
- type WorkflowSchemeUpdateRequest,
21
- type WorkflowSchemeUpdateRequiredMappingsRequest,
22
- type WorkflowSchemeUpdateRequiredMappingsResponse,
23
- } from "../models/workflow-schemes";
24
- import { validationSchemaStorage } from "../validation-schema-storage";
25
- /**
26
- * This resource represents workflow schemes. Use it to manage workflow schemes
27
- * and the workflow scheme's workflows and issue types.
28
- *
29
- * A workflow scheme maps issue types to workflows. A workflow scheme can be
30
- * associated with one or more projects, which enables the projects to use the
31
- * workflow-issue type mappings.
32
- *
33
- * Active workflow schemes (workflow schemes that are used by projects) cannot be
34
- * edited. When an active workflow scheme is edited, a draft copy of the scheme is
35
- * created. The draft workflow scheme is then be edited and published (replacing
36
- * the active scheme).
37
- *
38
- * See [Configuring workflow schemes](https://confluence.atlassian.com/x/tohKLg)
39
- * for more information.
40
- */
41
- export class WorkflowSchemesService extends CommonHttpService {
42
- /**
43
- * Creates a workflow scheme.
44
- *
45
- * **[Permissions](#permissions) required:** *Administer Jira* [global
46
- * permission](https://confluence.atlassian.com/x/x4dKLg).
47
- *
48
- * @returns Returned if the request is successful.
49
- *
50
- * example: {
51
- * "defaultWorkflow": "jira",
52
- * "description": "The description of the example workflow scheme.",
53
- * "draft": false,
54
- * "id": 101010,
55
- * "issueTypeMappings": {
56
- * "10000": "scrum workflow",
57
- * "10001": "builds workflow"
58
- * },
59
- * "name": "Example workflow scheme",
60
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
61
- * }
62
- * @path {POST} /rest/api/3/workflowscheme
63
- * @scopes-current manage:jira-configuration
64
- * @scopes-beta write:workflow-scheme:jira, read:application-role:jira, read:avatar:jira,
65
- * read:group:jira, read:issue-type:jira, read:project-category:jira,
66
- * read:project:jira, read:user:jira, read:workflow-scheme:jira
67
- */
68
- createWorkflowScheme({
69
- workflowScheme,
70
- }: {
71
- /**
72
- * @example {
73
- * "defaultWorkflow": "jira",
74
- * "description": "The description of the example workflow scheme.",
75
- * "issueTypeMappings": {
76
- * "10000": "scrum workflow",
77
- * "10001": "builds workflow"
78
- * },
79
- * "name": "Example workflow scheme"
80
- * }
81
- */
82
- workflowScheme: WorkflowScheme;
83
- }): Promise<WorkflowScheme> {
84
- return this.getClientInstance()
85
- .request({
86
- path: "/rest/api/3/workflowscheme",
87
- method: "POST",
88
- headers: {
89
- "Content-Type": "application/json",
90
- },
91
- body: workflowScheme,
92
- })
93
- .then(
94
- this.getClientInstance().responseHandler({
95
- 201: {
96
- "application/json": "json",
97
- },
98
- }),
99
- )
100
- .then(
101
- commonHttpClient.castResponse<{
102
- status: 201;
103
- mediaType: "application/json";
104
- body: WorkflowScheme;
105
- }>(),
106
- )
107
- .then(
108
- validationSchemaStorage.validator(
109
- "WorkflowSchemesService.createWorkflowScheme.response",
110
- ),
111
- )
112
- .then(commonHttpClient.getBody);
113
- }
114
- /**
115
- * Resets the default workflow for a workflow scheme. That is, the default
116
- * workflow is set to Jira's system workflow (the *jira* workflow).
117
- *
118
- * Note that active workflow schemes cannot be edited. If the workflow scheme is
119
- * active, set `updateDraftIfNeeded` to `true` and a draft workflow scheme is
120
- * created or updated with the default workflow reset. The draft workflow scheme
121
- * can be published in Jira.
122
- *
123
- * **[Permissions](#permissions) required:** *Administer Jira* [global
124
- * permission](https://confluence.atlassian.com/x/x4dKLg).
125
- *
126
- * @returns Returned if the request is successful.
127
- *
128
- * example: {
129
- * "defaultWorkflow": "jira",
130
- * "description": "The description of the example workflow scheme.",
131
- * "draft": false,
132
- * "id": 101010,
133
- * "issueTypeMappings": {
134
- * "10000": "scrum workflow",
135
- * "10001": "builds workflow"
136
- * },
137
- * "name": "Example workflow scheme",
138
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
139
- * }
140
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/default
141
- * @scopes-current manage:jira-configuration
142
- * @scopes-beta read:workflow-scheme:jira, write:workflow-scheme:jira,
143
- * read:application-role:jira, read:avatar:jira, read:group:jira,
144
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
145
- * read:user:jira
146
- */
147
- deleteDefaultWorkflow({
148
- id,
149
- updateDraftIfNeeded,
150
- }: {
151
- /** The ID of the workflow scheme. */
152
- id: number;
153
- /**
154
- * Set to true to create or update the draft of a workflow scheme and delete the
155
- * mapping from the draft, when the workflow scheme cannot be edited. Defaults to
156
- * `false`.
157
- */
158
- updateDraftIfNeeded?: boolean;
159
- }): Promise<WorkflowScheme> {
160
- return this.getClientInstance()
161
- .request({
162
- path: "/rest/api/3/workflowscheme/{id}/default",
163
- method: "DELETE",
164
- pathParams: {
165
- id,
166
- },
167
- query: {
168
- updateDraftIfNeeded,
169
- },
170
- })
171
- .then(
172
- this.getClientInstance().responseHandler({
173
- 200: {
174
- "application/json": "json",
175
- },
176
- }),
177
- )
178
- .then(
179
- commonHttpClient.castResponse<{
180
- status: 200;
181
- mediaType: "application/json";
182
- body: WorkflowScheme;
183
- }>(),
184
- )
185
- .then(
186
- validationSchemaStorage.validator(
187
- "WorkflowSchemesService.deleteDefaultWorkflow.response",
188
- ),
189
- )
190
- .then(commonHttpClient.getBody);
191
- }
192
- /**
193
- * Deletes the workflow-issue type mapping for a workflow in a workflow scheme.
194
- *
195
- * Note that active workflow schemes cannot be edited. If the workflow scheme is
196
- * active, set `updateDraftIfNeeded` to `true` and a draft workflow scheme is
197
- * created or updated with the workflow-issue type mapping deleted. The draft
198
- * workflow scheme can be published in Jira.
199
- *
200
- * **[Permissions](#permissions) required:** *Administer Jira* [global
201
- * permission](https://confluence.atlassian.com/x/x4dKLg).
202
- *
203
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/workflow
204
- * @scopes-current manage:jira-configuration
205
- * @scopes-beta delete:workflow-scheme:jira
206
- */
207
- deleteWorkflowMapping({
208
- id,
209
- workflowName,
210
- updateDraftIfNeeded,
211
- }: {
212
- /** The ID of the workflow scheme. */
213
- id: number;
214
- /** The name of the workflow. */
215
- workflowName: string;
216
- /**
217
- * Set to true to create or update the draft of a workflow scheme and delete the
218
- * mapping from the draft, when the workflow scheme cannot be edited. Defaults to
219
- * `false`.
220
- */
221
- updateDraftIfNeeded?: boolean;
222
- }): Promise<void> {
223
- return this.getClientInstance()
224
- .request({
225
- path: "/rest/api/3/workflowscheme/{id}/workflow",
226
- method: "DELETE",
227
- pathParams: {
228
- id,
229
- },
230
- query: {
231
- workflowName,
232
- updateDraftIfNeeded,
233
- },
234
- })
235
- .then(commonHttpClient.discardResult);
236
- }
237
- /**
238
- * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it
239
- * is active (that is, being used by at least one project).
240
- *
241
- * **[Permissions](#permissions) required:** *Administer Jira* [global
242
- * permission](https://confluence.atlassian.com/x/x4dKLg).
243
- *
244
- * @returns Returned if the request is successful.
245
- * @path {DELETE} /rest/api/3/workflowscheme/{id}
246
- * @scopes-current manage:jira-configuration
247
- * @scopes-beta delete:workflow-scheme:jira
248
- */
249
- deleteWorkflowScheme({
250
- id,
251
- }: {
252
- /**
253
- * The ID of the workflow scheme. Find this ID by editing the desired workflow
254
- * scheme in Jira. The ID is shown in the URL as `schemeId`. For example,
255
- * *schemeId=10301*.
256
- */
257
- id: number;
258
- }): Promise<void> {
259
- return this.getClientInstance()
260
- .request({
261
- path: "/rest/api/3/workflowscheme/{id}",
262
- method: "DELETE",
263
- pathParams: {
264
- id,
265
- },
266
- })
267
- .then(
268
- this.getClientInstance().responseHandler({
269
- 204: {
270
- "application/json": "json",
271
- },
272
- }),
273
- )
274
- .then(
275
- commonHttpClient.castResponse<{
276
- status: 204;
277
- mediaType: "application/json";
278
- body: void;
279
- }>(),
280
- )
281
- .then(
282
- validationSchemaStorage.validator(
283
- "WorkflowSchemesService.deleteWorkflowScheme.response",
284
- ),
285
- )
286
- .then(commonHttpClient.getBody);
287
- }
288
- /**
289
- * Deletes the issue type-workflow mapping for an issue type in a workflow scheme.
290
- *
291
- * Note that active workflow schemes cannot be edited. If the workflow scheme is
292
- * active, set `updateDraftIfNeeded` to `true` and a draft workflow scheme is
293
- * created or updated with the issue type-workflow mapping deleted. The draft
294
- * workflow scheme can be published in Jira.
295
- *
296
- * **[Permissions](#permissions) required:** *Administer Jira* [global
297
- * permission](https://confluence.atlassian.com/x/x4dKLg).
298
- *
299
- * @returns Returned if the request is successful.
300
- *
301
- * example: {
302
- * "defaultWorkflow": "jira",
303
- * "description": "The description of the example workflow scheme.",
304
- * "draft": false,
305
- * "id": 101010,
306
- * "issueTypeMappings": {
307
- * "10000": "scrum workflow",
308
- * "10001": "builds workflow"
309
- * },
310
- * "name": "Example workflow scheme",
311
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
312
- * }
313
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/issuetype/{issueType}
314
- * @scopes-current manage:jira-configuration
315
- * @scopes-beta delete:workflow-scheme:jira, read:application-role:jira, read:avatar:jira,
316
- * read:group:jira, read:issue-type:jira, read:project-category:jira,
317
- * read:project:jira, read:user:jira, read:workflow-scheme:jira, read:workflow:jira
318
- */
319
- deleteWorkflowSchemeIssueType({
320
- id,
321
- issueType,
322
- updateDraftIfNeeded,
323
- }: {
324
- /** The ID of the workflow scheme. */
325
- id: number;
326
- /** The ID of the issue type. */
327
- issueType: string;
328
- /**
329
- * Set to true to create or update the draft of a workflow scheme and update the
330
- * mapping in the draft, when the workflow scheme cannot be edited. Defaults to
331
- * `false`.
332
- */
333
- updateDraftIfNeeded?: boolean;
334
- }): Promise<WorkflowScheme> {
335
- return this.getClientInstance()
336
- .request({
337
- path: "/rest/api/3/workflowscheme/{id}/issuetype/{issueType}",
338
- method: "DELETE",
339
- pathParams: {
340
- id,
341
- issueType,
342
- },
343
- query: {
344
- updateDraftIfNeeded,
345
- },
346
- })
347
- .then(
348
- this.getClientInstance().responseHandler({
349
- 200: {
350
- "application/json": "json",
351
- },
352
- }),
353
- )
354
- .then(
355
- commonHttpClient.castResponse<{
356
- status: 200;
357
- mediaType: "application/json";
358
- body: WorkflowScheme;
359
- }>(),
360
- )
361
- .then(
362
- validationSchemaStorage.validator(
363
- "WorkflowSchemesService.deleteWorkflowSchemeIssueType.response",
364
- ),
365
- )
366
- .then(commonHttpClient.getBody);
367
- }
368
- /**
369
- * Returns a [paginated](#pagination) list of all workflow schemes, not including
370
- * draft workflow schemes.
371
- *
372
- * **[Permissions](#permissions) required:** *Administer Jira* [global
373
- * permission](https://confluence.atlassian.com/x/x4dKLg).
374
- *
375
- * @returns Returned if the request is successful.
376
- *
377
- * example: {
378
- * "isLast": true,
379
- * "maxResults": 50,
380
- * "startAt": 0,
381
- * "total": 2,
382
- * "values": [
383
- * {
384
- * "defaultWorkflow": "jira",
385
- * "description": "The description of the example workflow scheme.",
386
- * "id": 101010,
387
- * "issueTypeMappings": {
388
- * "10000": "scrum workflow",
389
- * "10001": "builds workflow"
390
- * },
391
- * "name": "Example workflow scheme",
392
- * "self":
393
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
394
- * },
395
- * {
396
- * "defaultWorkflow": "jira",
397
- * "description": "The description of the another example workflow scheme.",
398
- * "id": 101011,
399
- * "issueTypeMappings": {
400
- * "10000": "scrum workflow",
401
- * "10001": "builds workflow"
402
- * },
403
- * "name": "Another example workflow scheme",
404
- * "self":
405
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101011"
406
- * }
407
- * ]
408
- * }
409
- * @path {GET} /rest/api/3/workflowscheme
410
- * @scopes-current manage:jira-configuration
411
- * @scopes-beta read:workflow-scheme:jira, read:application-role:jira, read:avatar:jira,
412
- * read:group:jira, read:issue-type:jira, read:project-category:jira,
413
- * read:project:jira, read:user:jira
414
- */
415
- getAllWorkflowSchemes({
416
- startAt,
417
- maxResults,
418
- }: {
419
- /** The index of the first item to return in a page of results (page offset). */
420
- startAt?: number;
421
- /** The maximum number of items to return per page. */
422
- maxResults?: number;
423
- }): Promise<PageBeanWorkflowScheme> {
424
- return this.getClientInstance()
425
- .request({
426
- path: "/rest/api/3/workflowscheme",
427
- method: "GET",
428
- query: {
429
- startAt,
430
- maxResults,
431
- },
432
- })
433
- .then(
434
- this.getClientInstance().responseHandler({
435
- 200: {
436
- "application/json": "json",
437
- },
438
- }),
439
- )
440
- .then(
441
- commonHttpClient.castResponse<{
442
- status: 200;
443
- mediaType: "application/json";
444
- body: PageBeanWorkflowScheme;
445
- }>(),
446
- )
447
- .then(
448
- validationSchemaStorage.validator(
449
- "WorkflowSchemesService.getAllWorkflowSchemes.response",
450
- ),
451
- )
452
- .then(commonHttpClient.getBody);
453
- }
454
- /**
455
- * Returns the default workflow for a workflow scheme. The default workflow is the
456
- * workflow that is assigned any issue types that have not been mapped to any
457
- * other workflow. The default workflow has *All Unassigned Issue Types* listed in
458
- * its issue types for the workflow scheme in Jira.
459
- *
460
- * **[Permissions](#permissions) required:** *Administer Jira* [global
461
- * permission](https://confluence.atlassian.com/x/x4dKLg).
462
- *
463
- * @returns Returned if the request is successful.
464
- *
465
- * example: {
466
- * "workflow": "jira"
467
- * }
468
- * @path {GET} /rest/api/3/workflowscheme/{id}/default
469
- * @scopes-current manage:jira-configuration
470
- * @scopes-beta read:workflow-scheme:jira, read:workflow:jira
471
- */
472
- getDefaultWorkflow({
473
- id,
474
- returnDraftIfExists,
475
- }: {
476
- /** The ID of the workflow scheme. */
477
- id: number;
478
- /**
479
- * Set to `true` to return the default workflow for the workflow scheme's draft
480
- * rather than scheme itself. If the workflow scheme does not have a draft, then
481
- * the default workflow for the workflow scheme is returned.
482
- */
483
- returnDraftIfExists?: boolean;
484
- }): Promise<DefaultWorkflow> {
485
- return this.getClientInstance()
486
- .request({
487
- path: "/rest/api/3/workflowscheme/{id}/default",
488
- method: "GET",
489
- pathParams: {
490
- id,
491
- },
492
- query: {
493
- returnDraftIfExists,
494
- },
495
- })
496
- .then(
497
- this.getClientInstance().responseHandler({
498
- 200: {
499
- "application/json": "json",
500
- },
501
- }),
502
- )
503
- .then(
504
- commonHttpClient.castResponse<{
505
- status: 200;
506
- mediaType: "application/json";
507
- body: DefaultWorkflow;
508
- }>(),
509
- )
510
- .then(
511
- validationSchemaStorage.validator(
512
- "WorkflowSchemesService.getDefaultWorkflow.response",
513
- ),
514
- )
515
- .then(commonHttpClient.getBody);
516
- }
517
- /**
518
- * Returns the workflow-issue type mappings for a workflow scheme.
519
- *
520
- * **[Permissions](#permissions) required:** *Administer Jira* [global
521
- * permission](https://confluence.atlassian.com/x/x4dKLg).
522
- *
523
- * @returns Returned if the request is successful.
524
- *
525
- * example: {
526
- * "defaultMapping": false,
527
- * "issueTypes": [
528
- * "10000",
529
- * "10001"
530
- * ],
531
- * "workflow": "jira"
532
- * }
533
- * @path {GET} /rest/api/3/workflowscheme/{id}/workflow
534
- * @scopes-current manage:jira-configuration
535
- * @scopes-beta read:workflow-scheme:jira, read:workflow:jira, read:issue-type:jira
536
- */
537
- getWorkflow({
538
- id,
539
- workflowName,
540
- returnDraftIfExists,
541
- }: {
542
- /** The ID of the workflow scheme. */
543
- id: number;
544
- /**
545
- * The name of a workflow in the scheme. Limits the results to the workflow-issue
546
- * type mapping for the specified workflow.
547
- */
548
- workflowName?: string;
549
- /**
550
- * Returns the mapping from the workflow scheme's draft rather than the workflow
551
- * scheme, if set to true. If no draft exists, the mapping from the workflow
552
- * scheme is returned.
553
- */
554
- returnDraftIfExists?: boolean;
555
- }): Promise<IssueTypesWorkflowMapping> {
556
- return this.getClientInstance()
557
- .request({
558
- path: "/rest/api/3/workflowscheme/{id}/workflow",
559
- method: "GET",
560
- pathParams: {
561
- id,
562
- },
563
- query: {
564
- workflowName,
565
- returnDraftIfExists,
566
- },
567
- })
568
- .then(
569
- this.getClientInstance().responseHandler({
570
- 200: {
571
- "application/json": "json",
572
- },
573
- }),
574
- )
575
- .then(
576
- commonHttpClient.castResponse<{
577
- status: 200;
578
- mediaType: "application/json";
579
- body: IssueTypesWorkflowMapping;
580
- }>(),
581
- )
582
- .then(
583
- validationSchemaStorage.validator(
584
- "WorkflowSchemesService.getWorkflow.response",
585
- ),
586
- )
587
- .then(commonHttpClient.getBody);
588
- }
589
- /**
590
- * Returns a workflow scheme.
591
- *
592
- * **[Permissions](#permissions) required:** *Administer Jira* [global
593
- * permission](https://confluence.atlassian.com/x/x4dKLg).
594
- *
595
- * @returns Returned if the request is successful.
596
- *
597
- * example: {
598
- * "defaultWorkflow": "jira",
599
- * "description": "The description of the example workflow scheme.",
600
- * "draft": false,
601
- * "id": 101010,
602
- * "issueTypeMappings": {
603
- * "10000": "scrum workflow",
604
- * "10001": "builds workflow"
605
- * },
606
- * "name": "Example workflow scheme",
607
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
608
- * }
609
- * @path {GET} /rest/api/3/workflowscheme/{id}
610
- * @scopes-current manage:jira-configuration
611
- * @scopes-beta read:workflow-scheme:jira, read:application-role:jira, read:avatar:jira,
612
- * read:group:jira, read:issue-type:jira, read:project-category:jira,
613
- * read:project:jira, read:user:jira
614
- */
615
- getWorkflowScheme({
616
- id,
617
- returnDraftIfExists,
618
- }: {
619
- /**
620
- * The ID of the workflow scheme. Find this ID by editing the desired workflow
621
- * scheme in Jira. The ID is shown in the URL as `schemeId`. For example,
622
- * *schemeId=10301*.
623
- */
624
- id: number;
625
- /**
626
- * Returns the workflow scheme's draft rather than scheme itself, if set to true.
627
- * If the workflow scheme does not have a draft, then the workflow scheme is
628
- * returned.
629
- */
630
- returnDraftIfExists?: boolean;
631
- }): Promise<WorkflowScheme> {
632
- return this.getClientInstance()
633
- .request({
634
- path: "/rest/api/3/workflowscheme/{id}",
635
- method: "GET",
636
- pathParams: {
637
- id,
638
- },
639
- query: {
640
- returnDraftIfExists,
641
- },
642
- })
643
- .then(
644
- this.getClientInstance().responseHandler({
645
- 200: {
646
- "application/json": "json",
647
- },
648
- }),
649
- )
650
- .then(
651
- commonHttpClient.castResponse<{
652
- status: 200;
653
- mediaType: "application/json";
654
- body: WorkflowScheme;
655
- }>(),
656
- )
657
- .then(
658
- validationSchemaStorage.validator(
659
- "WorkflowSchemesService.getWorkflowScheme.response",
660
- ),
661
- )
662
- .then(commonHttpClient.getBody);
663
- }
664
- /**
665
- * Returns the issue type-workflow mapping for an issue type in a workflow scheme.
666
- *
667
- * **[Permissions](#permissions) required:** *Administer Jira* [global
668
- * permission](https://confluence.atlassian.com/x/x4dKLg).
669
- *
670
- * @returns Returned if the request is successful.
671
- *
672
- * example: {
673
- * "issueType": "10000",
674
- * "workflow": "jira"
675
- * }
676
- * @path {GET} /rest/api/3/workflowscheme/{id}/issuetype/{issueType}
677
- * @scopes-current manage:jira-configuration
678
- * @scopes-beta read:workflow-scheme:jira, read:workflow:jira, read:issue-type:jira
679
- */
680
- getWorkflowSchemeIssueType({
681
- id,
682
- issueType,
683
- returnDraftIfExists,
684
- }: {
685
- /** The ID of the workflow scheme. */
686
- id: number;
687
- /** The ID of the issue type. */
688
- issueType: string;
689
- /**
690
- * Returns the mapping from the workflow scheme's draft rather than the workflow
691
- * scheme, if set to true. If no draft exists, the mapping from the workflow
692
- * scheme is returned.
693
- */
694
- returnDraftIfExists?: boolean;
695
- }): Promise<IssueTypeWorkflowMapping> {
696
- return this.getClientInstance()
697
- .request({
698
- path: "/rest/api/3/workflowscheme/{id}/issuetype/{issueType}",
699
- method: "GET",
700
- pathParams: {
701
- id,
702
- issueType,
703
- },
704
- query: {
705
- returnDraftIfExists,
706
- },
707
- })
708
- .then(
709
- this.getClientInstance().responseHandler({
710
- 200: {
711
- "application/json": "json",
712
- },
713
- }),
714
- )
715
- .then(
716
- commonHttpClient.castResponse<{
717
- status: 200;
718
- mediaType: "application/json";
719
- body: IssueTypeWorkflowMapping;
720
- }>(),
721
- )
722
- .then(
723
- validationSchemaStorage.validator(
724
- "WorkflowSchemesService.getWorkflowSchemeIssueType.response",
725
- ),
726
- )
727
- .then(commonHttpClient.getBody);
728
- }
729
- /**
730
- * Returns a list of workflow schemes by providing workflow scheme IDs or project
731
- * IDs.
732
- *
733
- * **[Permissions](#permissions) required:**
734
- *
735
- * * *Administer Jira* global permission to access all, including
736
- * project-scoped, workflow schemes
737
- * * *Administer projects* project permissions to access project-scoped workflow
738
- * schemes
739
- *
740
- * @returns Returned if the request is successful.
741
- *
742
- * example: [
743
- * {
744
- * "defaultWorkflow": {
745
- * "description": "This is the default workflow for Software Development
746
- * projects.",
747
- * "id": "3e59db0f-ed6c-47ce-8d50-80c0c4572677",
748
- * "name": "Default Software Development Workflow",
749
- * "usage": [
750
- * {
751
- * "issueTypeIds": [],
752
- * "projectId": "10047"
753
- * }
754
- * ],
755
- * "version": {
756
- * "id": "657812fc-bc72-400f-aae0-df8d88db3d9g",
757
- * "versionNumber": 1
758
- * }
759
- * },
760
- * "description": "This is the workflow scheme for the Software Development
761
- * project type.",
762
- * "id": "3g78dg2a-ns2n-56ab-9812-42h5j1464567",
763
- * "name": "Software Developer Workflow Scheme",
764
- * "projectIdsUsingScheme": [
765
- * "10047"
766
- * ],
767
- * "scope": {
768
- * "project": {
769
- * "id": "10047"
770
- * },
771
- * "type": "GLOBAL"
772
- * },
773
- * "taskId": "3f83dg2a-ns2n-56ab-9812-42h5j1461629",
774
- * "version": {
775
- * "id": "527213fc-bc72-400f-aae0-df8d88db2c8a",
776
- * "versionNumber": 1
777
- * },
778
- * "workflowsForIssueTypes": [
779
- * {
780
- * "issueTypeIds": [
781
- * "10013"
782
- * ],
783
- * "workflow": {
784
- * "description": "This is the workflow for the Software Development bug
785
- * issue type.",
786
- * "id": "5e79ae0f-ed6c-47ce-8d50-80c0c4572745",
787
- * "name": "Software Development Bug Workflow",
788
- * "usage": [
789
- * {
790
- * "issueTypeIds": [
791
- * "10013"
792
- * ],
793
- * "projectId": "10047"
794
- * }
795
- * ],
796
- * "version": {
797
- * "id": "897812dc-bc72-400f-aae0-df8d88fe3d8f",
798
- * "versionNumber": 1
799
- * }
800
- * }
801
- * }
802
- * ]
803
- * }
804
- * ]
805
- * @path {POST} /rest/api/3/workflowscheme/read
806
- * @scopes-current manage:jira-configuration
807
- * @scopes-beta read:workflow-scheme:jira
808
- */
809
- readWorkflowSchemes({
810
- expand,
811
- workflowSchemeReadRequest,
812
- }: {
813
- /**
814
- * Use [expand](#expansion) to include additional information in the response.
815
- * This parameter accepts a comma-separated list. Expand options include:
816
- *
817
- * * `workflows.usages` Returns the project and issue types that each workflow
818
- * in the workflow scheme is associated with.
819
- */
820
- expand?: string;
821
- /**
822
- * @example {
823
- * "projectIds": [
824
- * "10047",
825
- * "10048"
826
- * ],
827
- * "workflowSchemeIds": [
828
- * "3e59db0f-ed6c-47ce-8d50-80c0c4572677"
829
- * ]
830
- * }
831
- */
832
- workflowSchemeReadRequest: WorkflowSchemeReadRequest;
833
- }): Promise<WorkflowSchemeReadResponse[]> {
834
- return this.getClientInstance()
835
- .request({
836
- path: "/rest/api/3/workflowscheme/read",
837
- method: "POST",
838
- query: {
839
- expand,
840
- },
841
- headers: {
842
- "Content-Type": "application/json",
843
- },
844
- body: workflowSchemeReadRequest,
845
- })
846
- .then(
847
- this.getClientInstance().responseHandler({
848
- 200: {
849
- "application/json": "json",
850
- },
851
- }),
852
- )
853
- .then(
854
- commonHttpClient.castResponse<{
855
- status: 200;
856
- mediaType: "application/json";
857
- body: WorkflowSchemeReadResponse[];
858
- }>(),
859
- )
860
- .then(
861
- validationSchemaStorage.validator(
862
- "WorkflowSchemesService.readWorkflowSchemes.response",
863
- ),
864
- )
865
- .then(commonHttpClient.getBody);
866
- }
867
- /**
868
- * Sets the workflow for an issue type in a workflow scheme.
869
- *
870
- * Note that active workflow schemes cannot be edited. If the workflow scheme is
871
- * active, set `updateDraftIfNeeded` to `true` in the request body and a draft
872
- * workflow scheme is created or updated with the new issue type-workflow mapping.
873
- * The draft workflow scheme can be published in Jira.
874
- *
875
- * **[Permissions](#permissions) required:** *Administer Jira* [global
876
- * permission](https://confluence.atlassian.com/x/x4dKLg).
877
- *
878
- * @returns Returned if the request is successful.
879
- *
880
- * example: {
881
- * "defaultWorkflow": "jira",
882
- * "description": "The description of the example workflow scheme.",
883
- * "draft": false,
884
- * "id": 101010,
885
- * "issueTypeMappings": {
886
- * "10000": "scrum workflow",
887
- * "10001": "builds workflow"
888
- * },
889
- * "name": "Example workflow scheme",
890
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
891
- * }
892
- * @path {PUT} /rest/api/3/workflowscheme/{id}/issuetype/{issueType}
893
- * @scopes-current manage:jira-configuration
894
- * @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira,
895
- * read:application-role:jira, read:avatar:jira, read:group:jira,
896
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
897
- * read:user:jira
898
- */
899
- setWorkflowSchemeIssueType({
900
- id,
901
- issueType,
902
- issueTypeWorkflowMapping,
903
- }: {
904
- /** The ID of the workflow scheme. */
905
- id: number;
906
- /** The ID of the issue type. */
907
- issueType: string;
908
- /**
909
- * The issue type-project mapping.
910
- *
911
- * @example {
912
- * "issueType": "10000",
913
- * "updateDraftIfNeeded": false,
914
- * "workflow": "jira"
915
- * }
916
- */
917
- issueTypeWorkflowMapping: IssueTypeWorkflowMapping;
918
- }): Promise<WorkflowScheme> {
919
- return this.getClientInstance()
920
- .request({
921
- path: "/rest/api/3/workflowscheme/{id}/issuetype/{issueType}",
922
- method: "PUT",
923
- pathParams: {
924
- id,
925
- issueType,
926
- },
927
- headers: {
928
- "Content-Type": "application/json",
929
- },
930
- body: issueTypeWorkflowMapping,
931
- })
932
- .then(
933
- this.getClientInstance().responseHandler({
934
- 200: {
935
- "application/json": "json",
936
- },
937
- }),
938
- )
939
- .then(
940
- commonHttpClient.castResponse<{
941
- status: 200;
942
- mediaType: "application/json";
943
- body: WorkflowScheme;
944
- }>(),
945
- )
946
- .then(
947
- validationSchemaStorage.validator(
948
- "WorkflowSchemesService.setWorkflowSchemeIssueType.response",
949
- ),
950
- )
951
- .then(commonHttpClient.getBody);
952
- }
953
- /**
954
- * Sets the default workflow for a workflow scheme.
955
- *
956
- * Note that active workflow schemes cannot be edited. If the workflow scheme is
957
- * active, set `updateDraftIfNeeded` to `true` in the request object and a draft
958
- * workflow scheme is created or updated with the new default workflow. The draft
959
- * workflow scheme can be published in Jira.
960
- *
961
- * **[Permissions](#permissions) required:** *Administer Jira* [global
962
- * permission](https://confluence.atlassian.com/x/x4dKLg).
963
- *
964
- * @returns Returned if the request is successful.
965
- *
966
- * example: {
967
- * "defaultWorkflow": "jira",
968
- * "description": "The description of the example workflow scheme.",
969
- * "draft": false,
970
- * "id": 101010,
971
- * "issueTypeMappings": {
972
- * "10000": "scrum workflow",
973
- * "10001": "builds workflow"
974
- * },
975
- * "name": "Example workflow scheme",
976
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
977
- * }
978
- * @path {PUT} /rest/api/3/workflowscheme/{id}/default
979
- * @scopes-current manage:jira-configuration
980
- * @scopes-beta read:workflow-scheme:jira, write:workflow-scheme:jira,
981
- * read:application-role:jira, read:avatar:jira, read:group:jira,
982
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
983
- * read:user:jira
984
- */
985
- updateDefaultWorkflow({
986
- id,
987
- defaultWorkflow,
988
- }: {
989
- /** The ID of the workflow scheme. */
990
- id: number;
991
- /**
992
- * The new default workflow.
993
- *
994
- * @example {
995
- * "updateDraftIfNeeded": false,
996
- * "workflow": "jira"
997
- * }
998
- */
999
- defaultWorkflow: DefaultWorkflow;
1000
- }): Promise<WorkflowScheme> {
1001
- return this.getClientInstance()
1002
- .request({
1003
- path: "/rest/api/3/workflowscheme/{id}/default",
1004
- method: "PUT",
1005
- pathParams: {
1006
- id,
1007
- },
1008
- headers: {
1009
- "Content-Type": "application/json",
1010
- },
1011
- body: defaultWorkflow,
1012
- })
1013
- .then(
1014
- this.getClientInstance().responseHandler({
1015
- 200: {
1016
- "application/json": "json",
1017
- },
1018
- }),
1019
- )
1020
- .then(
1021
- commonHttpClient.castResponse<{
1022
- status: 200;
1023
- mediaType: "application/json";
1024
- body: WorkflowScheme;
1025
- }>(),
1026
- )
1027
- .then(
1028
- validationSchemaStorage.validator(
1029
- "WorkflowSchemesService.updateDefaultWorkflow.response",
1030
- ),
1031
- )
1032
- .then(commonHttpClient.getBody);
1033
- }
1034
- /**
1035
- * Updates company-managed and team-managed project workflow schemes. This API
1036
- * doesn't have a concept of draft, so any changes made to a workflow scheme are
1037
- * immediately available. When changing the available statuses for issue types, an
1038
- * [asynchronous task](#async) migrates the issues as defined in the provided
1039
- * mappings.
1040
- *
1041
- * **[Permissions](#permissions) required:**
1042
- *
1043
- * * *Administer Jira* project permission to update all, including
1044
- * global-scoped, workflow schemes.
1045
- * * *Administer projects* project permission to update project-scoped workflow
1046
- * schemes.
1047
- *
1048
- * @returns Returned if the request is successful and there is no asynchronous task.
1049
- * @path {POST} /rest/api/3/workflowscheme/update
1050
- * @scopes-current manage:jira-configuration
1051
- * @scopes-beta write:workflow-scheme:jira
1052
- */
1053
- updateSchemes({
1054
- workflowSchemeUpdateRequest,
1055
- }: {
1056
- /**
1057
- * @example {
1058
- * "defaultWorkflowId": "3e59db0f-ed6c-47ce-8d50-80c0c4572677",
1059
- * "description": "description",
1060
- * "id": "10000",
1061
- * "name": "name",
1062
- * "statusMappingsByIssueTypeOverride": [
1063
- * {
1064
- * "issueTypeId": "10001",
1065
- * "statusMappings": [
1066
- * {
1067
- * "newStatusId": "2",
1068
- * "oldStatusId": "1"
1069
- * },
1070
- * {
1071
- * "newStatusId": "4",
1072
- * "oldStatusId": "3"
1073
- * }
1074
- * ]
1075
- * },
1076
- * {
1077
- * "issueTypeId": "10002",
1078
- * "statusMappings": [
1079
- * {
1080
- * "newStatusId": "4",
1081
- * "oldStatusId": "1"
1082
- * },
1083
- * {
1084
- * "newStatusId": "2",
1085
- * "oldStatusId": "3"
1086
- * }
1087
- * ]
1088
- * }
1089
- * ],
1090
- * "statusMappingsByWorkflows": [
1091
- * {
1092
- * "newWorkflowId": "3e59db0f-ed6c-47ce-8d50-80c0c4572677",
1093
- * "oldWorkflowId": "3e59db0f-ed6c-47ce-8d50-80c0c4572677",
1094
- * "statusMappings": [
1095
- * {
1096
- * "newStatusId": "2",
1097
- * "oldStatusId": "1"
1098
- * },
1099
- * {
1100
- * "newStatusId": "4",
1101
- * "oldStatusId": "3"
1102
- * }
1103
- * ]
1104
- * }
1105
- * ],
1106
- * "version": {
1107
- * "id": "527213fc-bc72-400f-aae0-df8d88db2c8a",
1108
- * "versionNumber": 1
1109
- * },
1110
- * "workflowsForIssueTypes": [
1111
- * {
1112
- * "issueTypeIds": [
1113
- * "10000",
1114
- * "10003"
1115
- * ],
1116
- * "workflowId": "3e59db0f-ed6c-47ce-8d50-80c0c4572677"
1117
- * },
1118
- * {
1119
- * "issueTypeIds": [
1120
- * "10001`",
1121
- * "10002"
1122
- * ],
1123
- * "workflowId": "3f83dg2a-ns2n-56ab-9812-42h5j1461629"
1124
- * }
1125
- * ]
1126
- * }
1127
- */
1128
- workflowSchemeUpdateRequest: WorkflowSchemeUpdateRequest;
1129
- }): Promise<unknown> {
1130
- return this.getClientInstance()
1131
- .request({
1132
- path: "/rest/api/3/workflowscheme/update",
1133
- method: "POST",
1134
- headers: {
1135
- "Content-Type": "application/json",
1136
- },
1137
- body: workflowSchemeUpdateRequest,
1138
- })
1139
- .then(
1140
- this.getClientInstance().responseHandler({
1141
- 200: {
1142
- "application/json": "json",
1143
- },
1144
- }),
1145
- )
1146
- .then(
1147
- commonHttpClient.castResponse<{
1148
- status: 200;
1149
- mediaType: "application/json";
1150
- body: unknown;
1151
- }>(),
1152
- )
1153
- .then(
1154
- validationSchemaStorage.validator(
1155
- "WorkflowSchemesService.updateSchemes.response",
1156
- ),
1157
- )
1158
- .then(commonHttpClient.getBody);
1159
- }
1160
- /**
1161
- * Sets the issue types for a workflow in a workflow scheme. The workflow can also
1162
- * be set as the default workflow for the workflow scheme. Unmapped issues types
1163
- * are mapped to the default workflow.
1164
- *
1165
- * Note that active workflow schemes cannot be edited. If the workflow scheme is
1166
- * active, set `updateDraftIfNeeded` to `true` in the request body and a draft
1167
- * workflow scheme is created or updated with the new workflow-issue types
1168
- * mappings. The draft workflow scheme can be published in Jira.
1169
- *
1170
- * **[Permissions](#permissions) required:** *Administer Jira* [global
1171
- * permission](https://confluence.atlassian.com/x/x4dKLg).
1172
- *
1173
- * @returns Returned if the request is successful.
1174
- *
1175
- * example: {
1176
- * "defaultWorkflow": "jira",
1177
- * "description": "The description of the example workflow scheme.",
1178
- * "draft": false,
1179
- * "id": 101010,
1180
- * "issueTypeMappings": {
1181
- * "10000": "scrum workflow",
1182
- * "10001": "builds workflow"
1183
- * },
1184
- * "name": "Example workflow scheme",
1185
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
1186
- * }
1187
- * @path {PUT} /rest/api/3/workflowscheme/{id}/workflow
1188
- * @scopes-current manage:jira-configuration
1189
- * @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira,
1190
- * read:application-role:jira, read:avatar:jira, read:group:jira,
1191
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
1192
- * read:user:jira
1193
- */
1194
- updateWorkflowMapping({
1195
- id,
1196
- workflowName,
1197
- issueTypesWorkflowMapping,
1198
- }: {
1199
- /** The ID of the workflow scheme. */
1200
- id: number;
1201
- /** The name of the workflow. */
1202
- workflowName: string;
1203
- /**
1204
- * @example {
1205
- * "issueTypes": [
1206
- * "10000"
1207
- * ],
1208
- * "updateDraftIfNeeded": true,
1209
- * "workflow": "jira"
1210
- * }
1211
- */
1212
- issueTypesWorkflowMapping: IssueTypesWorkflowMapping;
1213
- }): Promise<WorkflowScheme> {
1214
- return this.getClientInstance()
1215
- .request({
1216
- path: "/rest/api/3/workflowscheme/{id}/workflow",
1217
- method: "PUT",
1218
- pathParams: {
1219
- id,
1220
- },
1221
- query: {
1222
- workflowName,
1223
- },
1224
- headers: {
1225
- "Content-Type": "application/json",
1226
- },
1227
- body: issueTypesWorkflowMapping,
1228
- })
1229
- .then(
1230
- this.getClientInstance().responseHandler({
1231
- 200: {
1232
- "application/json": "json",
1233
- },
1234
- }),
1235
- )
1236
- .then(
1237
- commonHttpClient.castResponse<{
1238
- status: 200;
1239
- mediaType: "application/json";
1240
- body: WorkflowScheme;
1241
- }>(),
1242
- )
1243
- .then(
1244
- validationSchemaStorage.validator(
1245
- "WorkflowSchemesService.updateWorkflowMapping.response",
1246
- ),
1247
- )
1248
- .then(commonHttpClient.getBody);
1249
- }
1250
- /**
1251
- * Updates a company-manged project workflow scheme, including the name, default
1252
- * workflow, issue type to project mappings, and more. If the workflow scheme is
1253
- * active (that is, being used by at least one project), then a draft workflow
1254
- * scheme is created or updated instead, provided that `updateDraftIfNeeded` is
1255
- * set to `true`.
1256
- *
1257
- * **[Permissions](#permissions) required:** *Administer Jira* [global
1258
- * permission](https://confluence.atlassian.com/x/x4dKLg).
1259
- *
1260
- * @returns Returned if the request is successful.
1261
- *
1262
- * example: {
1263
- * "defaultWorkflow": "jira",
1264
- * "description": "The description of the example workflow scheme.",
1265
- * "draft": false,
1266
- * "id": 101010,
1267
- * "issueTypeMappings": {
1268
- * "10000": "scrum workflow",
1269
- * "10001": "builds workflow"
1270
- * },
1271
- * "name": "Example workflow scheme",
1272
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
1273
- * }
1274
- * @path {PUT} /rest/api/3/workflowscheme/{id}
1275
- * @scopes-current manage:jira-configuration
1276
- * @scopes-beta read:workflow-scheme:jira, write:workflow-scheme:jira,
1277
- * read:application-role:jira, read:avatar:jira, read:group:jira,
1278
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
1279
- * read:user:jira
1280
- */
1281
- updateWorkflowScheme({
1282
- id,
1283
- workflowScheme,
1284
- }: {
1285
- /**
1286
- * The ID of the workflow scheme. Find this ID by editing the desired workflow
1287
- * scheme in Jira. The ID is shown in the URL as `schemeId`. For example,
1288
- * *schemeId=10301*.
1289
- */
1290
- id: number;
1291
- /**
1292
- * @example {
1293
- * "defaultWorkflow": "jira",
1294
- * "description": "The description of the example workflow scheme.",
1295
- * "issueTypeMappings": {
1296
- * "10000": "scrum workflow"
1297
- * },
1298
- * "name": "Example workflow scheme",
1299
- * "updateDraftIfNeeded": false
1300
- * }
1301
- */
1302
- workflowScheme: WorkflowScheme;
1303
- }): Promise<WorkflowScheme> {
1304
- return this.getClientInstance()
1305
- .request({
1306
- path: "/rest/api/3/workflowscheme/{id}",
1307
- method: "PUT",
1308
- pathParams: {
1309
- id,
1310
- },
1311
- headers: {
1312
- "Content-Type": "application/json",
1313
- },
1314
- body: workflowScheme,
1315
- })
1316
- .then(
1317
- this.getClientInstance().responseHandler({
1318
- 200: {
1319
- "application/json": "json",
1320
- },
1321
- }),
1322
- )
1323
- .then(
1324
- commonHttpClient.castResponse<{
1325
- status: 200;
1326
- mediaType: "application/json";
1327
- body: WorkflowScheme;
1328
- }>(),
1329
- )
1330
- .then(
1331
- validationSchemaStorage.validator(
1332
- "WorkflowSchemesService.updateWorkflowScheme.response",
1333
- ),
1334
- )
1335
- .then(commonHttpClient.getBody);
1336
- }
1337
- /**
1338
- * Gets the required status mappings for the desired changes to a workflow scheme.
1339
- * The results are provided per issue type and workflow. When updating a workflow
1340
- * scheme, status mappings can be provided per issue type, per workflow, or both.
1341
- *
1342
- * **[Permissions](#permissions) required:**
1343
- *
1344
- * * *Administer Jira* permission to update all, including global-scoped,
1345
- * workflow schemes.
1346
- * * *Administer projects* project permission to update project-scoped workflow
1347
- * schemes.
1348
- *
1349
- * @returns Returned if the request is successful.
1350
- *
1351
- * example: {
1352
- * "statusMappingsByIssueTypes": [
1353
- * {
1354
- * "issueTypeId": "10000",
1355
- * "statusIds": [
1356
- * "10000",
1357
- * "10001"
1358
- * ]
1359
- * }
1360
- * ],
1361
- * "statusMappingsByWorkflows": [
1362
- * {
1363
- * "sourceWorkflowId": "10000",
1364
- * "statusIds": [
1365
- * "10000",
1366
- * "10001"
1367
- * ],
1368
- * "targetWorkflowId": "10001"
1369
- * }
1370
- * ],
1371
- * "statuses": [
1372
- * {
1373
- * "category": "TODO",
1374
- * "id": "10000",
1375
- * "name": "To Do"
1376
- * }
1377
- * ],
1378
- * "statusesPerWorkflow": [
1379
- * {
1380
- * "initialStatusId": "10000",
1381
- * "statuses": [
1382
- * "10000",
1383
- * "10001"
1384
- * ],
1385
- * "workflowId": "10000"
1386
- * }
1387
- * ]
1388
- * }
1389
- * @path {POST} /rest/api/3/workflowscheme/update/mappings
1390
- * @scopes-current manage:jira-configuration
1391
- * @scopes-beta write:workflow-scheme:jira
1392
- */
1393
- updateWorkflowSchemeMappings({
1394
- workflowSchemeUpdateRequiredMappingsRequest,
1395
- }: {
1396
- /**
1397
- * @example {
1398
- * "defaultWorkflowId": "10010",
1399
- * "id": "10001",
1400
- * "workflowsForIssueTypes": [
1401
- * {
1402
- * "issueTypeIds": [
1403
- * "10010",
1404
- * "10011"
1405
- * ],
1406
- * "workflowId": "10001"
1407
- * }
1408
- * ]
1409
- * }
1410
- */
1411
- workflowSchemeUpdateRequiredMappingsRequest: WorkflowSchemeUpdateRequiredMappingsRequest;
1412
- }): Promise<WorkflowSchemeUpdateRequiredMappingsResponse> {
1413
- return this.getClientInstance()
1414
- .request({
1415
- path: "/rest/api/3/workflowscheme/update/mappings",
1416
- method: "POST",
1417
- headers: {
1418
- "Content-Type": "application/json",
1419
- },
1420
- body: workflowSchemeUpdateRequiredMappingsRequest,
1421
- })
1422
- .then(
1423
- this.getClientInstance().responseHandler({
1424
- 200: {
1425
- "application/json": "json",
1426
- },
1427
- }),
1428
- )
1429
- .then(
1430
- commonHttpClient.castResponse<{
1431
- status: 200;
1432
- mediaType: "application/json";
1433
- body: WorkflowSchemeUpdateRequiredMappingsResponse;
1434
- }>(),
1435
- )
1436
- .then(
1437
- validationSchemaStorage.validator(
1438
- "WorkflowSchemesService.updateWorkflowSchemeMappings.response",
1439
- ),
1440
- )
1441
- .then(commonHttpClient.getBody);
1442
- }
1443
- static initialize() {
1444
- validationSchemaStorage.registerExtensible(
1445
- "WorkflowSchemesService.getAllWorkflowSchemes.response",
1446
- z
1447
- .object({
1448
- status: z.literal(200),
1449
- mediaType: z.literal("application/json"),
1450
- body: validationSchemaStorage.lazy("PageBeanWorkflowScheme"),
1451
- })
1452
- .describe("WorkflowSchemesService.getAllWorkflowSchemes.response"),
1453
- );
1454
- validationSchemaStorage.registerExtensible(
1455
- "WorkflowSchemesService.createWorkflowScheme.response",
1456
- z
1457
- .object({
1458
- status: z.literal(201),
1459
- mediaType: z.literal("application/json"),
1460
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1461
- })
1462
- .describe("WorkflowSchemesService.createWorkflowScheme.response"),
1463
- );
1464
- validationSchemaStorage.registerExtensible(
1465
- "WorkflowSchemesService.getWorkflowScheme.response",
1466
- z
1467
- .object({
1468
- status: z.literal(200),
1469
- mediaType: z.literal("application/json"),
1470
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1471
- })
1472
- .describe("WorkflowSchemesService.getWorkflowScheme.response"),
1473
- );
1474
- validationSchemaStorage.registerExtensible(
1475
- "WorkflowSchemesService.updateWorkflowScheme.response",
1476
- z
1477
- .object({
1478
- status: z.literal(200),
1479
- mediaType: z.literal("application/json"),
1480
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1481
- })
1482
- .describe("WorkflowSchemesService.updateWorkflowScheme.response"),
1483
- );
1484
- validationSchemaStorage.registerExtensible(
1485
- "WorkflowSchemesService.deleteWorkflowScheme.response",
1486
- z
1487
- .object({
1488
- status: z.literal(204),
1489
- mediaType: z.literal("application/json"),
1490
- body: z.unknown(),
1491
- })
1492
- .describe("WorkflowSchemesService.deleteWorkflowScheme.response"),
1493
- );
1494
- validationSchemaStorage.registerExtensible(
1495
- "WorkflowSchemesService.getDefaultWorkflow.response",
1496
- z
1497
- .object({
1498
- status: z.literal(200),
1499
- mediaType: z.literal("application/json"),
1500
- body: validationSchemaStorage.lazy("DefaultWorkflow"),
1501
- })
1502
- .describe("WorkflowSchemesService.getDefaultWorkflow.response"),
1503
- );
1504
- validationSchemaStorage.registerExtensible(
1505
- "WorkflowSchemesService.updateDefaultWorkflow.response",
1506
- z
1507
- .object({
1508
- status: z.literal(200),
1509
- mediaType: z.literal("application/json"),
1510
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1511
- })
1512
- .describe("WorkflowSchemesService.updateDefaultWorkflow.response"),
1513
- );
1514
- validationSchemaStorage.registerExtensible(
1515
- "WorkflowSchemesService.deleteDefaultWorkflow.response",
1516
- z
1517
- .object({
1518
- status: z.literal(200),
1519
- mediaType: z.literal("application/json"),
1520
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1521
- })
1522
- .describe("WorkflowSchemesService.deleteDefaultWorkflow.response"),
1523
- );
1524
- validationSchemaStorage.registerExtensible(
1525
- "WorkflowSchemesService.getWorkflowSchemeIssueType.response",
1526
- z
1527
- .object({
1528
- status: z.literal(200),
1529
- mediaType: z.literal("application/json"),
1530
- body: validationSchemaStorage.lazy("IssueTypeWorkflowMapping"),
1531
- })
1532
- .describe("WorkflowSchemesService.getWorkflowSchemeIssueType.response"),
1533
- );
1534
- validationSchemaStorage.registerExtensible(
1535
- "WorkflowSchemesService.setWorkflowSchemeIssueType.response",
1536
- z
1537
- .object({
1538
- status: z.literal(200),
1539
- mediaType: z.literal("application/json"),
1540
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1541
- })
1542
- .describe("WorkflowSchemesService.setWorkflowSchemeIssueType.response"),
1543
- );
1544
- validationSchemaStorage.registerExtensible(
1545
- "WorkflowSchemesService.deleteWorkflowSchemeIssueType.response",
1546
- z
1547
- .object({
1548
- status: z.literal(200),
1549
- mediaType: z.literal("application/json"),
1550
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1551
- })
1552
- .describe(
1553
- "WorkflowSchemesService.deleteWorkflowSchemeIssueType.response",
1554
- ),
1555
- );
1556
- validationSchemaStorage.registerExtensible(
1557
- "WorkflowSchemesService.getWorkflow.response",
1558
- z
1559
- .object({
1560
- status: z.literal(200),
1561
- mediaType: z.literal("application/json"),
1562
- body: validationSchemaStorage.lazy("IssueTypesWorkflowMapping"),
1563
- })
1564
- .describe("WorkflowSchemesService.getWorkflow.response"),
1565
- );
1566
- validationSchemaStorage.registerExtensible(
1567
- "WorkflowSchemesService.updateWorkflowMapping.response",
1568
- z
1569
- .object({
1570
- status: z.literal(200),
1571
- mediaType: z.literal("application/json"),
1572
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1573
- })
1574
- .describe("WorkflowSchemesService.updateWorkflowMapping.response"),
1575
- );
1576
- validationSchemaStorage.registerExtensible(
1577
- "WorkflowSchemesService.readWorkflowSchemes.response",
1578
- z
1579
- .object({
1580
- status: z.literal(200),
1581
- mediaType: z.literal("application/json"),
1582
- body: z.array(
1583
- validationSchemaStorage.lazy("WorkflowSchemeReadResponse"),
1584
- ),
1585
- })
1586
- .describe("WorkflowSchemesService.readWorkflowSchemes.response"),
1587
- );
1588
- validationSchemaStorage.registerExtensible(
1589
- "WorkflowSchemesService.updateSchemes.response",
1590
- z
1591
- .object({
1592
- status: z.literal(200),
1593
- mediaType: z.literal("application/json"),
1594
- body: z.unknown(),
1595
- })
1596
- .describe("WorkflowSchemesService.updateSchemes.response"),
1597
- );
1598
- validationSchemaStorage.registerExtensible(
1599
- "WorkflowSchemesService.updateWorkflowSchemeMappings.response",
1600
- z
1601
- .object({
1602
- status: z.literal(200),
1603
- mediaType: z.literal("application/json"),
1604
- body: validationSchemaStorage.lazy(
1605
- "WorkflowSchemeUpdateRequiredMappingsResponse",
1606
- ),
1607
- })
1608
- .describe(
1609
- "WorkflowSchemesService.updateWorkflowSchemeMappings.response",
1610
- ),
1611
- );
1612
- validationSchemaStorage.registerOnce([
1613
- registerWorkflowSchemesValidationSchemas,
1614
- registerCommonValidationSchemas,
1615
- ]);
1616
- }
1617
- }