@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,1313 +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 type { PublishDraftWorkflowScheme } from "../models/workflow-scheme-drafts";
16
- import { validationSchemaStorage } from "../validation-schema-storage";
17
- /**
18
- * This resource represents draft workflow schemes. Use it to manage drafts of
19
- * workflow schemes.
20
- *
21
- * A workflow scheme maps issue types to workflows. A workflow scheme can be
22
- * associated with one or more projects, which enables the projects to use the
23
- * workflow-issue type mappings.
24
- *
25
- * Active workflow schemes (workflow schemes that are used by projects) cannot be
26
- * edited. Editing an active workflow scheme creates a draft copy of the scheme.
27
- * The draft workflow scheme can then be edited and published (replacing the
28
- * active scheme).
29
- *
30
- * See [Configuring workflow schemes](https://confluence.atlassian.com/x/tohKLg)
31
- * for more information.
32
- */
33
- export class WorkflowSchemeDraftsService extends CommonHttpService {
34
- /**
35
- * Create a draft workflow scheme from an active workflow scheme, by copying the
36
- * active workflow scheme. Note that an active workflow scheme can only have one
37
- * draft workflow scheme.
38
- *
39
- * **[Permissions](#permissions) required:** *Administer Jira* [global
40
- * permission](https://confluence.atlassian.com/x/x4dKLg).
41
- *
42
- * @returns Returned if the request is successful.
43
- *
44
- * example: {
45
- * "defaultWorkflow": "scrum workflow",
46
- * "description": "The description of the example workflow scheme.",
47
- * "draft": true,
48
- * "id": 17218781,
49
- * "issueTypeMappings": {
50
- * "10000": "jira",
51
- * "10001": "jira"
52
- * },
53
- * "lastModified": "Today 6:38 PM",
54
- * "lastModifiedUser": {
55
- * "accountId": "5b10a2844c20165700ede21g",
56
- * "accountType": "atlassian",
57
- * "active": true,
58
- * "applicationRoles": {
59
- * "items": [],
60
- * "size": 1
61
- * },
62
- * "avatarUrls": {
63
- * "16x16":
64
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
65
- * "24x24":
66
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
67
- * "32x32":
68
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
69
- * "48x48":
70
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
71
- * },
72
- * "displayName": "Mia Krystof",
73
- * "emailAddress": "mia@example.com",
74
- * "groups": {
75
- * "items": [],
76
- * "size": 3
77
- * },
78
- * "key": "",
79
- * "name": "",
80
- * "self":
81
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
82
- * "timeZone": "Australia/Sydney"
83
- * },
84
- * "name": "Example workflow scheme",
85
- * "originalDefaultWorkflow": "jira",
86
- * "originalIssueTypeMappings": {
87
- * "10001": "builds workflow"
88
- * },
89
- * "self":
90
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
91
- * }
92
- * @path {POST} /rest/api/3/workflowscheme/{id}/createdraft
93
- * @scopes-current manage:jira-configuration
94
- * @scopes-beta read:group:jira, read:issue-security-level:jira, read:project-role:jira,
95
- * read:screen:jira, read:status:jira, read:user:jira, read:workflow-scheme:jira,
96
- * read:workflow:jira, write:workflow-scheme:jira, read:application-role:jira,
97
- * read:avatar:jira, read:issue-type:jira, read:project-category:jira,
98
- * read:project:jira
99
- */
100
- createWorkflowSchemeDraftFromParent({
101
- id,
102
- }: {
103
- /** The ID of the active workflow scheme that the draft is created from. */
104
- id: number;
105
- }): Promise<WorkflowScheme> {
106
- return this.getClientInstance()
107
- .request({
108
- path: "/rest/api/3/workflowscheme/{id}/createdraft",
109
- method: "POST",
110
- pathParams: {
111
- id,
112
- },
113
- })
114
- .then(
115
- this.getClientInstance().responseHandler({
116
- 201: {
117
- "application/json": "json",
118
- },
119
- }),
120
- )
121
- .then(
122
- commonHttpClient.castResponse<{
123
- status: 201;
124
- mediaType: "application/json";
125
- body: WorkflowScheme;
126
- }>(),
127
- )
128
- .then(
129
- validationSchemaStorage.validator(
130
- "WorkflowSchemeDraftsService.createWorkflowSchemeDraftFromParent.response",
131
- ),
132
- )
133
- .then(commonHttpClient.getBody);
134
- }
135
- /**
136
- * Resets the default workflow for a workflow scheme's draft. That is, the default
137
- * workflow is set to Jira's system workflow (the *jira* workflow).
138
- *
139
- * **[Permissions](#permissions) required:** *Administer Jira* [global
140
- * permission](https://confluence.atlassian.com/x/x4dKLg).
141
- *
142
- * @returns Returned if the request is successful.
143
- *
144
- * example: {
145
- * "defaultWorkflow": "scrum workflow",
146
- * "description": "The description of the example workflow scheme.",
147
- * "draft": true,
148
- * "id": 17218781,
149
- * "issueTypeMappings": {
150
- * "10000": "jira",
151
- * "10001": "jira"
152
- * },
153
- * "lastModified": "Today 6:38 PM",
154
- * "lastModifiedUser": {
155
- * "accountId": "5b10a2844c20165700ede21g",
156
- * "accountType": "atlassian",
157
- * "active": true,
158
- * "applicationRoles": {
159
- * "items": [],
160
- * "size": 1
161
- * },
162
- * "avatarUrls": {
163
- * "16x16":
164
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
165
- * "24x24":
166
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
167
- * "32x32":
168
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
169
- * "48x48":
170
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
171
- * },
172
- * "displayName": "Mia Krystof",
173
- * "emailAddress": "mia@example.com",
174
- * "groups": {
175
- * "items": [],
176
- * "size": 3
177
- * },
178
- * "key": "",
179
- * "name": "",
180
- * "self":
181
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
182
- * "timeZone": "Australia/Sydney"
183
- * },
184
- * "name": "Example workflow scheme",
185
- * "originalDefaultWorkflow": "jira",
186
- * "originalIssueTypeMappings": {
187
- * "10001": "builds workflow"
188
- * },
189
- * "self":
190
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
191
- * }
192
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/draft/default
193
- * @scopes-current manage:jira-configuration
194
- * @scopes-beta delete:workflow-scheme:jira, read:application-role:jira, read:avatar:jira,
195
- * read:group:jira, read:issue-type:jira, read:project-category:jira,
196
- * read:project:jira, read:user:jira, read:workflow-scheme:jira, read:workflow:jira
197
- */
198
- deleteDraftDefaultWorkflow({
199
- id,
200
- }: {
201
- /** The ID of the workflow scheme that the draft belongs to. */
202
- id: number;
203
- }): Promise<WorkflowScheme> {
204
- return this.getClientInstance()
205
- .request({
206
- path: "/rest/api/3/workflowscheme/{id}/draft/default",
207
- method: "DELETE",
208
- pathParams: {
209
- id,
210
- },
211
- })
212
- .then(
213
- this.getClientInstance().responseHandler({
214
- 200: {
215
- "application/json": "json",
216
- },
217
- }),
218
- )
219
- .then(
220
- commonHttpClient.castResponse<{
221
- status: 200;
222
- mediaType: "application/json";
223
- body: WorkflowScheme;
224
- }>(),
225
- )
226
- .then(
227
- validationSchemaStorage.validator(
228
- "WorkflowSchemeDraftsService.deleteDraftDefaultWorkflow.response",
229
- ),
230
- )
231
- .then(commonHttpClient.getBody);
232
- }
233
- /**
234
- * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's
235
- * draft.
236
- *
237
- * **[Permissions](#permissions) required:** *Administer Jira* [global
238
- * permission](https://confluence.atlassian.com/x/x4dKLg).
239
- *
240
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/draft/workflow
241
- * @scopes-current manage:jira-configuration
242
- * @scopes-beta delete:workflow-scheme:jira
243
- */
244
- deleteDraftWorkflowMapping({
245
- id,
246
- workflowName,
247
- }: {
248
- /** The ID of the workflow scheme that the draft belongs to. */
249
- id: number;
250
- /** The name of the workflow. */
251
- workflowName: string;
252
- }): Promise<void> {
253
- return this.getClientInstance()
254
- .request({
255
- path: "/rest/api/3/workflowscheme/{id}/draft/workflow",
256
- method: "DELETE",
257
- pathParams: {
258
- id,
259
- },
260
- query: {
261
- workflowName,
262
- },
263
- })
264
- .then(commonHttpClient.discardResult);
265
- }
266
- /**
267
- * Deletes a draft workflow scheme.
268
- *
269
- * **[Permissions](#permissions) required:** *Administer Jira* [global
270
- * permission](https://confluence.atlassian.com/x/x4dKLg).
271
- *
272
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/draft
273
- * @scopes-current manage:jira-configuration
274
- * @scopes-beta delete:workflow-scheme:jira
275
- */
276
- deleteWorkflowSchemeDraft({
277
- id,
278
- }: {
279
- /** The ID of the active workflow scheme that the draft was created from. */
280
- id: number;
281
- }): Promise<void> {
282
- return this.getClientInstance()
283
- .request({
284
- path: "/rest/api/3/workflowscheme/{id}/draft",
285
- method: "DELETE",
286
- pathParams: {
287
- id,
288
- },
289
- })
290
- .then(commonHttpClient.discardResult);
291
- }
292
- /**
293
- * Deletes the issue type-workflow mapping for an issue type in a workflow
294
- * scheme's draft.
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": "scrum workflow",
303
- * "description": "The description of the example workflow scheme.",
304
- * "draft": true,
305
- * "id": 17218781,
306
- * "issueTypeMappings": {
307
- * "10000": "jira",
308
- * "10001": "jira"
309
- * },
310
- * "lastModified": "Today 6:38 PM",
311
- * "lastModifiedUser": {
312
- * "accountId": "5b10a2844c20165700ede21g",
313
- * "accountType": "atlassian",
314
- * "active": true,
315
- * "applicationRoles": {
316
- * "items": [],
317
- * "size": 1
318
- * },
319
- * "avatarUrls": {
320
- * "16x16":
321
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
322
- * "24x24":
323
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
324
- * "32x32":
325
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
326
- * "48x48":
327
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
328
- * },
329
- * "displayName": "Mia Krystof",
330
- * "emailAddress": "mia@example.com",
331
- * "groups": {
332
- * "items": [],
333
- * "size": 3
334
- * },
335
- * "key": "",
336
- * "name": "",
337
- * "self":
338
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
339
- * "timeZone": "Australia/Sydney"
340
- * },
341
- * "name": "Example workflow scheme",
342
- * "originalDefaultWorkflow": "jira",
343
- * "originalIssueTypeMappings": {
344
- * "10001": "builds workflow"
345
- * },
346
- * "self":
347
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
348
- * }
349
- * @path {DELETE} /rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType}
350
- * @scopes-current manage:jira-configuration
351
- * @scopes-beta delete:workflow-scheme:jira, read:application-role:jira, read:avatar:jira,
352
- * read:group:jira, read:issue-type:jira, read:project-category:jira,
353
- * read:project:jira, read:user:jira, read:workflow-scheme:jira, read:workflow:jira
354
- */
355
- deleteWorkflowSchemeDraftIssueType({
356
- id,
357
- issueType,
358
- }: {
359
- /** The ID of the workflow scheme that the draft belongs to. */
360
- id: number;
361
- /** The ID of the issue type. */
362
- issueType: string;
363
- }): Promise<WorkflowScheme> {
364
- return this.getClientInstance()
365
- .request({
366
- path: "/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType}",
367
- method: "DELETE",
368
- pathParams: {
369
- id,
370
- issueType,
371
- },
372
- })
373
- .then(
374
- this.getClientInstance().responseHandler({
375
- 200: {
376
- "application/json": "json",
377
- },
378
- }),
379
- )
380
- .then(
381
- commonHttpClient.castResponse<{
382
- status: 200;
383
- mediaType: "application/json";
384
- body: WorkflowScheme;
385
- }>(),
386
- )
387
- .then(
388
- validationSchemaStorage.validator(
389
- "WorkflowSchemeDraftsService.deleteWorkflowSchemeDraftIssueType.response",
390
- ),
391
- )
392
- .then(commonHttpClient.getBody);
393
- }
394
- /**
395
- * Returns the default workflow for a workflow scheme's draft. The default
396
- * workflow is the workflow that is assigned any issue types that have not been
397
- * mapped to any other workflow. The default workflow has *All Unassigned Issue
398
- * Types* listed in its issue types for the workflow scheme in Jira.
399
- *
400
- * **[Permissions](#permissions) required:** *Administer Jira* [global
401
- * permission](https://confluence.atlassian.com/x/x4dKLg).
402
- *
403
- * @returns Returned if the request is successful.
404
- *
405
- * example: {
406
- * "workflow": "jira"
407
- * }
408
- * @path {GET} /rest/api/3/workflowscheme/{id}/draft/default
409
- * @scopes-current manage:jira-configuration
410
- * @scopes-beta read:workflow-scheme:jira, read:workflow:jira
411
- */
412
- getDraftDefaultWorkflow({
413
- id,
414
- }: {
415
- /** The ID of the workflow scheme that the draft belongs to. */
416
- id: number;
417
- }): Promise<DefaultWorkflow> {
418
- return this.getClientInstance()
419
- .request({
420
- path: "/rest/api/3/workflowscheme/{id}/draft/default",
421
- method: "GET",
422
- pathParams: {
423
- id,
424
- },
425
- })
426
- .then(
427
- this.getClientInstance().responseHandler({
428
- 200: {
429
- "application/json": "json",
430
- },
431
- }),
432
- )
433
- .then(
434
- commonHttpClient.castResponse<{
435
- status: 200;
436
- mediaType: "application/json";
437
- body: DefaultWorkflow;
438
- }>(),
439
- )
440
- .then(
441
- validationSchemaStorage.validator(
442
- "WorkflowSchemeDraftsService.getDraftDefaultWorkflow.response",
443
- ),
444
- )
445
- .then(commonHttpClient.getBody);
446
- }
447
- /**
448
- * Returns the workflow-issue type mappings for a workflow scheme's draft.
449
- *
450
- * **[Permissions](#permissions) required:** *Administer Jira* [global
451
- * permission](https://confluence.atlassian.com/x/x4dKLg).
452
- *
453
- * @returns Returned if the request is successful.
454
- *
455
- * example: {
456
- * "defaultMapping": false,
457
- * "issueTypes": [
458
- * "10000",
459
- * "10001"
460
- * ],
461
- * "workflow": "jira"
462
- * }
463
- * @path {GET} /rest/api/3/workflowscheme/{id}/draft/workflow
464
- * @scopes-current manage:jira-configuration
465
- * @scopes-beta read:workflow-scheme:jira, read:workflow:jira, read:issue-type:jira
466
- */
467
- getDraftWorkflow({
468
- id,
469
- workflowName,
470
- }: {
471
- /** The ID of the workflow scheme that the draft belongs to. */
472
- id: number;
473
- /**
474
- * The name of a workflow in the scheme. Limits the results to the workflow-issue
475
- * type mapping for the specified workflow.
476
- */
477
- workflowName?: string;
478
- }): Promise<IssueTypesWorkflowMapping> {
479
- return this.getClientInstance()
480
- .request({
481
- path: "/rest/api/3/workflowscheme/{id}/draft/workflow",
482
- method: "GET",
483
- pathParams: {
484
- id,
485
- },
486
- query: {
487
- workflowName,
488
- },
489
- })
490
- .then(
491
- this.getClientInstance().responseHandler({
492
- 200: {
493
- "application/json": "json",
494
- },
495
- }),
496
- )
497
- .then(
498
- commonHttpClient.castResponse<{
499
- status: 200;
500
- mediaType: "application/json";
501
- body: IssueTypesWorkflowMapping;
502
- }>(),
503
- )
504
- .then(
505
- validationSchemaStorage.validator(
506
- "WorkflowSchemeDraftsService.getDraftWorkflow.response",
507
- ),
508
- )
509
- .then(commonHttpClient.getBody);
510
- }
511
- /**
512
- * Returns the draft workflow scheme for an active workflow scheme. Draft workflow
513
- * schemes allow changes to be made to the active workflow schemes: When an active
514
- * workflow scheme is updated, a draft copy is created. The draft is modified,
515
- * then the changes in the draft are copied back to the active workflow scheme.
516
- * See [Configuring workflow schemes](https://confluence.atlassian.com/x/tohKLg)
517
- * for more information.
518
- * Note that:
519
- *
520
- * * Only active workflow schemes can have draft workflow schemes.
521
- * * An active workflow scheme can only have one draft workflow scheme.
522
- *
523
- * **[Permissions](#permissions) required:** *Administer Jira* [global
524
- * permission](https://confluence.atlassian.com/x/x4dKLg).
525
- *
526
- * @returns Returned if the request is successful.
527
- *
528
- * example: {
529
- * "defaultWorkflow": "scrum workflow",
530
- * "description": "The description of the example workflow scheme.",
531
- * "draft": true,
532
- * "id": 17218781,
533
- * "issueTypeMappings": {
534
- * "10000": "jira",
535
- * "10001": "jira"
536
- * },
537
- * "lastModified": "Today 6:38 PM",
538
- * "lastModifiedUser": {
539
- * "accountId": "5b10a2844c20165700ede21g",
540
- * "accountType": "atlassian",
541
- * "active": true,
542
- * "applicationRoles": {
543
- * "items": [],
544
- * "size": 1
545
- * },
546
- * "avatarUrls": {
547
- * "16x16":
548
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
549
- * "24x24":
550
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
551
- * "32x32":
552
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
553
- * "48x48":
554
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
555
- * },
556
- * "displayName": "Mia Krystof",
557
- * "emailAddress": "mia@example.com",
558
- * "groups": {
559
- * "items": [],
560
- * "size": 3
561
- * },
562
- * "key": "",
563
- * "name": "",
564
- * "self":
565
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
566
- * "timeZone": "Australia/Sydney"
567
- * },
568
- * "name": "Example workflow scheme",
569
- * "originalDefaultWorkflow": "jira",
570
- * "originalIssueTypeMappings": {
571
- * "10001": "builds workflow"
572
- * },
573
- * "self":
574
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
575
- * }
576
- * @path {GET} /rest/api/3/workflowscheme/{id}/draft
577
- * @scopes-current manage:jira-configuration
578
- * @scopes-beta read:group:jira, read:issue-security-level:jira, read:project-role:jira,
579
- * read:screen:jira, read:status:jira, read:user:jira, read:workflow-scheme:jira,
580
- * read:workflow:jira, read:application-role:jira, read:avatar:jira,
581
- * read:issue-type:jira, read:project-category:jira, read:project:jira
582
- */
583
- getWorkflowSchemeDraft({
584
- id,
585
- }: {
586
- /** The ID of the active workflow scheme that the draft was created from. */
587
- id: number;
588
- }): Promise<WorkflowScheme> {
589
- return this.getClientInstance()
590
- .request({
591
- path: "/rest/api/3/workflowscheme/{id}/draft",
592
- method: "GET",
593
- pathParams: {
594
- id,
595
- },
596
- })
597
- .then(
598
- this.getClientInstance().responseHandler({
599
- 200: {
600
- "application/json": "json",
601
- },
602
- }),
603
- )
604
- .then(
605
- commonHttpClient.castResponse<{
606
- status: 200;
607
- mediaType: "application/json";
608
- body: WorkflowScheme;
609
- }>(),
610
- )
611
- .then(
612
- validationSchemaStorage.validator(
613
- "WorkflowSchemeDraftsService.getWorkflowSchemeDraft.response",
614
- ),
615
- )
616
- .then(commonHttpClient.getBody);
617
- }
618
- /**
619
- * Returns the issue type-workflow mapping for an issue type in a workflow
620
- * scheme's draft.
621
- *
622
- * **[Permissions](#permissions) required:** *Administer Jira* [global
623
- * permission](https://confluence.atlassian.com/x/x4dKLg).
624
- *
625
- * @returns Returned if the request is successful.
626
- *
627
- * example: {
628
- * "issueType": "10000",
629
- * "workflow": "jira"
630
- * }
631
- * @path {GET} /rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType}
632
- * @scopes-current manage:jira-configuration
633
- * @scopes-beta read:workflow-scheme:jira, read:workflow:jira, read:issue-type:jira
634
- */
635
- getWorkflowSchemeDraftIssueType({
636
- id,
637
- issueType,
638
- }: {
639
- /** The ID of the workflow scheme that the draft belongs to. */
640
- id: number;
641
- /** The ID of the issue type. */
642
- issueType: string;
643
- }): Promise<IssueTypeWorkflowMapping> {
644
- return this.getClientInstance()
645
- .request({
646
- path: "/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType}",
647
- method: "GET",
648
- pathParams: {
649
- id,
650
- issueType,
651
- },
652
- })
653
- .then(
654
- this.getClientInstance().responseHandler({
655
- 200: {
656
- "application/json": "json",
657
- },
658
- }),
659
- )
660
- .then(
661
- commonHttpClient.castResponse<{
662
- status: 200;
663
- mediaType: "application/json";
664
- body: IssueTypeWorkflowMapping;
665
- }>(),
666
- )
667
- .then(
668
- validationSchemaStorage.validator(
669
- "WorkflowSchemeDraftsService.getWorkflowSchemeDraftIssueType.response",
670
- ),
671
- )
672
- .then(commonHttpClient.getBody);
673
- }
674
- /**
675
- * Publishes a draft workflow scheme.
676
- *
677
- * Where the draft workflow includes new workflow statuses for an issue type,
678
- * mappings are provided to update issues with the original workflow status to the
679
- * new workflow status.
680
- *
681
- * This operation is [asynchronous](#async). Follow the `location` link in the
682
- * response to determine the status of the task and use [Get
683
- * task](#api-rest-api-3-task-taskId-get) to obtain updates.
684
- *
685
- * **[Permissions](#permissions) required:** *Administer Jira* [global
686
- * permission](https://confluence.atlassian.com/x/x4dKLg).
687
- *
688
- * @path {POST} /rest/api/3/workflowscheme/{id}/draft/publish
689
- * @scopes-current manage:jira-configuration
690
- * @scopes-beta write:workflow-scheme:jira
691
- */
692
- publishDraftWorkflowScheme({
693
- id,
694
- validateOnly,
695
- publishDraftWorkflowScheme,
696
- }: {
697
- /** The ID of the workflow scheme that the draft belongs to. */
698
- id: number;
699
- /** Whether the request only performs a validation. */
700
- validateOnly?: boolean;
701
- /**
702
- * Details of the status mappings.
703
- *
704
- * @example {
705
- * "statusMappings": [
706
- * {
707
- * "issueTypeId": "10001",
708
- * "newStatusId": "1",
709
- * "statusId": "3"
710
- * },
711
- * {
712
- * "issueTypeId": "10001",
713
- * "newStatusId": "2",
714
- * "statusId": "2"
715
- * },
716
- * {
717
- * "issueTypeId": "10002",
718
- * "newStatusId": "10003",
719
- * "statusId": "10005"
720
- * },
721
- * {
722
- * "issueTypeId": "10003",
723
- * "newStatusId": "1",
724
- * "statusId": "4"
725
- * }
726
- * ]
727
- * }
728
- */
729
- publishDraftWorkflowScheme: PublishDraftWorkflowScheme;
730
- }): Promise<void> {
731
- return this.getClientInstance()
732
- .request({
733
- path: "/rest/api/3/workflowscheme/{id}/draft/publish",
734
- method: "POST",
735
- pathParams: {
736
- id,
737
- },
738
- query: {
739
- validateOnly,
740
- },
741
- headers: {
742
- "Content-Type": "application/json",
743
- },
744
- body: publishDraftWorkflowScheme,
745
- })
746
- .then(commonHttpClient.discardResult);
747
- }
748
- /**
749
- * Sets the workflow for an issue type in a workflow scheme's draft.
750
- *
751
- * **[Permissions](#permissions) required:** *Administer Jira* [global
752
- * permission](https://confluence.atlassian.com/x/x4dKLg).
753
- *
754
- * @returns Returned if the request is successful.
755
- *
756
- * example: {
757
- * "defaultWorkflow": "scrum workflow",
758
- * "description": "The description of the example workflow scheme.",
759
- * "draft": true,
760
- * "id": 17218781,
761
- * "issueTypeMappings": {
762
- * "10000": "jira",
763
- * "10001": "jira"
764
- * },
765
- * "lastModified": "Today 6:38 PM",
766
- * "lastModifiedUser": {
767
- * "accountId": "5b10a2844c20165700ede21g",
768
- * "accountType": "atlassian",
769
- * "active": true,
770
- * "applicationRoles": {
771
- * "items": [],
772
- * "size": 1
773
- * },
774
- * "avatarUrls": {
775
- * "16x16":
776
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
777
- * "24x24":
778
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
779
- * "32x32":
780
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
781
- * "48x48":
782
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
783
- * },
784
- * "displayName": "Mia Krystof",
785
- * "emailAddress": "mia@example.com",
786
- * "groups": {
787
- * "items": [],
788
- * "size": 3
789
- * },
790
- * "key": "",
791
- * "name": "",
792
- * "self":
793
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
794
- * "timeZone": "Australia/Sydney"
795
- * },
796
- * "name": "Example workflow scheme",
797
- * "originalDefaultWorkflow": "jira",
798
- * "originalIssueTypeMappings": {
799
- * "10001": "builds workflow"
800
- * },
801
- * "self":
802
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
803
- * }
804
- * @path {PUT} /rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType}
805
- * @scopes-current manage:jira-configuration
806
- * @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira,
807
- * read:application-role:jira, read:avatar:jira, read:group:jira,
808
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
809
- * read:user:jira
810
- */
811
- setWorkflowSchemeDraftIssueType({
812
- id,
813
- issueType,
814
- issueTypeWorkflowMapping,
815
- }: {
816
- /** The ID of the workflow scheme that the draft belongs to. */
817
- id: number;
818
- /** The ID of the issue type. */
819
- issueType: string;
820
- /**
821
- * The issue type-project mapping.
822
- *
823
- * @example {
824
- * "issueType": "10000",
825
- * "updateDraftIfNeeded": false,
826
- * "workflow": "jira"
827
- * }
828
- */
829
- issueTypeWorkflowMapping: IssueTypeWorkflowMapping;
830
- }): Promise<WorkflowScheme> {
831
- return this.getClientInstance()
832
- .request({
833
- path: "/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType}",
834
- method: "PUT",
835
- pathParams: {
836
- id,
837
- issueType,
838
- },
839
- headers: {
840
- "Content-Type": "application/json",
841
- },
842
- body: issueTypeWorkflowMapping,
843
- })
844
- .then(
845
- this.getClientInstance().responseHandler({
846
- 200: {
847
- "application/json": "json",
848
- },
849
- }),
850
- )
851
- .then(
852
- commonHttpClient.castResponse<{
853
- status: 200;
854
- mediaType: "application/json";
855
- body: WorkflowScheme;
856
- }>(),
857
- )
858
- .then(
859
- validationSchemaStorage.validator(
860
- "WorkflowSchemeDraftsService.setWorkflowSchemeDraftIssueType.response",
861
- ),
862
- )
863
- .then(commonHttpClient.getBody);
864
- }
865
- /**
866
- * Sets the default workflow for a workflow scheme's draft.
867
- *
868
- * **[Permissions](#permissions) required:** *Administer Jira* [global
869
- * permission](https://confluence.atlassian.com/x/x4dKLg).
870
- *
871
- * @returns Returned if the request is successful.
872
- *
873
- * example: {
874
- * "defaultWorkflow": "scrum workflow",
875
- * "description": "The description of the example workflow scheme.",
876
- * "draft": true,
877
- * "id": 17218781,
878
- * "issueTypeMappings": {
879
- * "10000": "jira",
880
- * "10001": "jira"
881
- * },
882
- * "lastModified": "Today 6:38 PM",
883
- * "lastModifiedUser": {
884
- * "accountId": "5b10a2844c20165700ede21g",
885
- * "accountType": "atlassian",
886
- * "active": true,
887
- * "applicationRoles": {
888
- * "items": [],
889
- * "size": 1
890
- * },
891
- * "avatarUrls": {
892
- * "16x16":
893
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
894
- * "24x24":
895
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
896
- * "32x32":
897
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
898
- * "48x48":
899
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
900
- * },
901
- * "displayName": "Mia Krystof",
902
- * "emailAddress": "mia@example.com",
903
- * "groups": {
904
- * "items": [],
905
- * "size": 3
906
- * },
907
- * "key": "",
908
- * "name": "",
909
- * "self":
910
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
911
- * "timeZone": "Australia/Sydney"
912
- * },
913
- * "name": "Example workflow scheme",
914
- * "originalDefaultWorkflow": "jira",
915
- * "originalIssueTypeMappings": {
916
- * "10001": "builds workflow"
917
- * },
918
- * "self":
919
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
920
- * }
921
- * @path {PUT} /rest/api/3/workflowscheme/{id}/draft/default
922
- * @scopes-current manage:jira-configuration
923
- * @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira,
924
- * read:application-role:jira, read:avatar:jira, read:group:jira,
925
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
926
- * read:user:jira
927
- */
928
- updateDraftDefaultWorkflow({
929
- id,
930
- defaultWorkflow,
931
- }: {
932
- /** The ID of the workflow scheme that the draft belongs to. */
933
- id: number;
934
- /**
935
- * The object for the new default workflow.
936
- *
937
- * @example {
938
- * "updateDraftIfNeeded": false,
939
- * "workflow": "jira"
940
- * }
941
- */
942
- defaultWorkflow: DefaultWorkflow;
943
- }): Promise<WorkflowScheme> {
944
- return this.getClientInstance()
945
- .request({
946
- path: "/rest/api/3/workflowscheme/{id}/draft/default",
947
- method: "PUT",
948
- pathParams: {
949
- id,
950
- },
951
- headers: {
952
- "Content-Type": "application/json",
953
- },
954
- body: defaultWorkflow,
955
- })
956
- .then(
957
- this.getClientInstance().responseHandler({
958
- 200: {
959
- "application/json": "json",
960
- },
961
- }),
962
- )
963
- .then(
964
- commonHttpClient.castResponse<{
965
- status: 200;
966
- mediaType: "application/json";
967
- body: WorkflowScheme;
968
- }>(),
969
- )
970
- .then(
971
- validationSchemaStorage.validator(
972
- "WorkflowSchemeDraftsService.updateDraftDefaultWorkflow.response",
973
- ),
974
- )
975
- .then(commonHttpClient.getBody);
976
- }
977
- /**
978
- * Sets the issue types for a workflow in a workflow scheme's draft. The workflow
979
- * can also be set as the default workflow for the draft workflow scheme. Unmapped
980
- * issues types are mapped to the default workflow.
981
- *
982
- * **[Permissions](#permissions) required:** *Administer Jira* [global
983
- * permission](https://confluence.atlassian.com/x/x4dKLg).
984
- *
985
- * @returns Returned if the request is successful.
986
- *
987
- * example: {
988
- * "defaultWorkflow": "jira",
989
- * "description": "The description of the example workflow scheme.",
990
- * "draft": false,
991
- * "id": 101010,
992
- * "issueTypeMappings": {
993
- * "10000": "scrum workflow",
994
- * "10001": "builds workflow"
995
- * },
996
- * "name": "Example workflow scheme",
997
- * "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
998
- * }
999
- * @path {PUT} /rest/api/3/workflowscheme/{id}/draft/workflow
1000
- * @scopes-current manage:jira-configuration
1001
- * @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira,
1002
- * read:application-role:jira, read:avatar:jira, read:group:jira,
1003
- * read:issue-type:jira, read:project-category:jira, read:project:jira,
1004
- * read:user:jira
1005
- */
1006
- updateDraftWorkflowMapping({
1007
- id,
1008
- workflowName,
1009
- issueTypesWorkflowMapping,
1010
- }: {
1011
- /** The ID of the workflow scheme that the draft belongs to. */
1012
- id: number;
1013
- /** The name of the workflow. */
1014
- workflowName: string;
1015
- /**
1016
- * @example {
1017
- * "issueTypes": [
1018
- * "10000"
1019
- * ],
1020
- * "updateDraftIfNeeded": true,
1021
- * "workflow": "jira"
1022
- * }
1023
- */
1024
- issueTypesWorkflowMapping: IssueTypesWorkflowMapping;
1025
- }): Promise<WorkflowScheme> {
1026
- return this.getClientInstance()
1027
- .request({
1028
- path: "/rest/api/3/workflowscheme/{id}/draft/workflow",
1029
- method: "PUT",
1030
- pathParams: {
1031
- id,
1032
- },
1033
- query: {
1034
- workflowName,
1035
- },
1036
- headers: {
1037
- "Content-Type": "application/json",
1038
- },
1039
- body: issueTypesWorkflowMapping,
1040
- })
1041
- .then(
1042
- this.getClientInstance().responseHandler({
1043
- 200: {
1044
- "application/json": "json",
1045
- },
1046
- }),
1047
- )
1048
- .then(
1049
- commonHttpClient.castResponse<{
1050
- status: 200;
1051
- mediaType: "application/json";
1052
- body: WorkflowScheme;
1053
- }>(),
1054
- )
1055
- .then(
1056
- validationSchemaStorage.validator(
1057
- "WorkflowSchemeDraftsService.updateDraftWorkflowMapping.response",
1058
- ),
1059
- )
1060
- .then(commonHttpClient.getBody);
1061
- }
1062
- /**
1063
- * Updates a draft workflow scheme. If a draft workflow scheme does not exist for
1064
- * the active workflow scheme, then a draft is created. Note that an active
1065
- * workflow scheme can only have one draft workflow scheme.
1066
- *
1067
- * **[Permissions](#permissions) required:** *Administer Jira* [global
1068
- * permission](https://confluence.atlassian.com/x/x4dKLg).
1069
- *
1070
- * @returns Returned if the request is successful.
1071
- *
1072
- * example: {
1073
- * "defaultWorkflow": "scrum workflow",
1074
- * "description": "The description of the example workflow scheme.",
1075
- * "draft": true,
1076
- * "id": 17218781,
1077
- * "issueTypeMappings": {
1078
- * "10000": "jira",
1079
- * "10001": "jira"
1080
- * },
1081
- * "lastModified": "Today 6:38 PM",
1082
- * "lastModifiedUser": {
1083
- * "accountId": "5b10a2844c20165700ede21g",
1084
- * "accountType": "atlassian",
1085
- * "active": true,
1086
- * "applicationRoles": {
1087
- * "items": [],
1088
- * "size": 1
1089
- * },
1090
- * "avatarUrls": {
1091
- * "16x16":
1092
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
1093
- * "24x24":
1094
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
1095
- * "32x32":
1096
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
1097
- * "48x48":
1098
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
1099
- * },
1100
- * "displayName": "Mia Krystof",
1101
- * "emailAddress": "mia@example.com",
1102
- * "groups": {
1103
- * "items": [],
1104
- * "size": 3
1105
- * },
1106
- * "key": "",
1107
- * "name": "",
1108
- * "self":
1109
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
1110
- * "timeZone": "Australia/Sydney"
1111
- * },
1112
- * "name": "Example workflow scheme",
1113
- * "originalDefaultWorkflow": "jira",
1114
- * "originalIssueTypeMappings": {
1115
- * "10001": "builds workflow"
1116
- * },
1117
- * "self":
1118
- * "https://your-domain.atlassian.net/rest/api/3/workflowscheme/17218781/draft"
1119
- * }
1120
- * @path {PUT} /rest/api/3/workflowscheme/{id}/draft
1121
- * @scopes-current manage:jira-configuration
1122
- * @scopes-beta read:group:jira, read:issue-security-level:jira, read:project-role:jira,
1123
- * read:screen:jira, read:status:jira, read:user:jira, read:workflow-scheme:jira,
1124
- * read:workflow:jira, write:workflow-scheme:jira, read:application-role:jira,
1125
- * read:avatar:jira, read:issue-type:jira, read:project-category:jira,
1126
- * read:project:jira
1127
- */
1128
- updateWorkflowSchemeDraft({
1129
- id,
1130
- workflowScheme,
1131
- }: {
1132
- /** The ID of the active workflow scheme that the draft was created from. */
1133
- id: number;
1134
- /**
1135
- * @example {
1136
- * "defaultWorkflow": "jira",
1137
- * "description": "The description of the example workflow scheme.",
1138
- * "issueTypeMappings": {
1139
- * "10000": "scrum workflow"
1140
- * },
1141
- * "name": "Example workflow scheme",
1142
- * "updateDraftIfNeeded": false
1143
- * }
1144
- */
1145
- workflowScheme: WorkflowScheme;
1146
- }): Promise<WorkflowScheme> {
1147
- return this.getClientInstance()
1148
- .request({
1149
- path: "/rest/api/3/workflowscheme/{id}/draft",
1150
- method: "PUT",
1151
- pathParams: {
1152
- id,
1153
- },
1154
- headers: {
1155
- "Content-Type": "application/json",
1156
- },
1157
- body: workflowScheme,
1158
- })
1159
- .then(
1160
- this.getClientInstance().responseHandler({
1161
- 200: {
1162
- "application/json": "json",
1163
- },
1164
- }),
1165
- )
1166
- .then(
1167
- commonHttpClient.castResponse<{
1168
- status: 200;
1169
- mediaType: "application/json";
1170
- body: WorkflowScheme;
1171
- }>(),
1172
- )
1173
- .then(
1174
- validationSchemaStorage.validator(
1175
- "WorkflowSchemeDraftsService.updateWorkflowSchemeDraft.response",
1176
- ),
1177
- )
1178
- .then(commonHttpClient.getBody);
1179
- }
1180
- static initialize() {
1181
- validationSchemaStorage.registerExtensible(
1182
- "WorkflowSchemeDraftsService.createWorkflowSchemeDraftFromParent.response",
1183
- z
1184
- .object({
1185
- status: z.literal(201),
1186
- mediaType: z.literal("application/json"),
1187
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1188
- })
1189
- .describe(
1190
- "WorkflowSchemeDraftsService.createWorkflowSchemeDraftFromParent.response",
1191
- ),
1192
- );
1193
- validationSchemaStorage.registerExtensible(
1194
- "WorkflowSchemeDraftsService.getWorkflowSchemeDraft.response",
1195
- z
1196
- .object({
1197
- status: z.literal(200),
1198
- mediaType: z.literal("application/json"),
1199
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1200
- })
1201
- .describe(
1202
- "WorkflowSchemeDraftsService.getWorkflowSchemeDraft.response",
1203
- ),
1204
- );
1205
- validationSchemaStorage.registerExtensible(
1206
- "WorkflowSchemeDraftsService.updateWorkflowSchemeDraft.response",
1207
- z
1208
- .object({
1209
- status: z.literal(200),
1210
- mediaType: z.literal("application/json"),
1211
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1212
- })
1213
- .describe(
1214
- "WorkflowSchemeDraftsService.updateWorkflowSchemeDraft.response",
1215
- ),
1216
- );
1217
- validationSchemaStorage.registerExtensible(
1218
- "WorkflowSchemeDraftsService.getDraftDefaultWorkflow.response",
1219
- z
1220
- .object({
1221
- status: z.literal(200),
1222
- mediaType: z.literal("application/json"),
1223
- body: validationSchemaStorage.lazy("DefaultWorkflow"),
1224
- })
1225
- .describe(
1226
- "WorkflowSchemeDraftsService.getDraftDefaultWorkflow.response",
1227
- ),
1228
- );
1229
- validationSchemaStorage.registerExtensible(
1230
- "WorkflowSchemeDraftsService.updateDraftDefaultWorkflow.response",
1231
- z
1232
- .object({
1233
- status: z.literal(200),
1234
- mediaType: z.literal("application/json"),
1235
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1236
- })
1237
- .describe(
1238
- "WorkflowSchemeDraftsService.updateDraftDefaultWorkflow.response",
1239
- ),
1240
- );
1241
- validationSchemaStorage.registerExtensible(
1242
- "WorkflowSchemeDraftsService.deleteDraftDefaultWorkflow.response",
1243
- z
1244
- .object({
1245
- status: z.literal(200),
1246
- mediaType: z.literal("application/json"),
1247
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1248
- })
1249
- .describe(
1250
- "WorkflowSchemeDraftsService.deleteDraftDefaultWorkflow.response",
1251
- ),
1252
- );
1253
- validationSchemaStorage.registerExtensible(
1254
- "WorkflowSchemeDraftsService.getWorkflowSchemeDraftIssueType.response",
1255
- z
1256
- .object({
1257
- status: z.literal(200),
1258
- mediaType: z.literal("application/json"),
1259
- body: validationSchemaStorage.lazy("IssueTypeWorkflowMapping"),
1260
- })
1261
- .describe(
1262
- "WorkflowSchemeDraftsService.getWorkflowSchemeDraftIssueType.response",
1263
- ),
1264
- );
1265
- validationSchemaStorage.registerExtensible(
1266
- "WorkflowSchemeDraftsService.setWorkflowSchemeDraftIssueType.response",
1267
- z
1268
- .object({
1269
- status: z.literal(200),
1270
- mediaType: z.literal("application/json"),
1271
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1272
- })
1273
- .describe(
1274
- "WorkflowSchemeDraftsService.setWorkflowSchemeDraftIssueType.response",
1275
- ),
1276
- );
1277
- validationSchemaStorage.registerExtensible(
1278
- "WorkflowSchemeDraftsService.deleteWorkflowSchemeDraftIssueType.response",
1279
- z
1280
- .object({
1281
- status: z.literal(200),
1282
- mediaType: z.literal("application/json"),
1283
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1284
- })
1285
- .describe(
1286
- "WorkflowSchemeDraftsService.deleteWorkflowSchemeDraftIssueType.response",
1287
- ),
1288
- );
1289
- validationSchemaStorage.registerExtensible(
1290
- "WorkflowSchemeDraftsService.getDraftWorkflow.response",
1291
- z
1292
- .object({
1293
- status: z.literal(200),
1294
- mediaType: z.literal("application/json"),
1295
- body: validationSchemaStorage.lazy("IssueTypesWorkflowMapping"),
1296
- })
1297
- .describe("WorkflowSchemeDraftsService.getDraftWorkflow.response"),
1298
- );
1299
- validationSchemaStorage.registerExtensible(
1300
- "WorkflowSchemeDraftsService.updateDraftWorkflowMapping.response",
1301
- z
1302
- .object({
1303
- status: z.literal(200),
1304
- mediaType: z.literal("application/json"),
1305
- body: validationSchemaStorage.lazy("WorkflowScheme"),
1306
- })
1307
- .describe(
1308
- "WorkflowSchemeDraftsService.updateDraftWorkflowMapping.response",
1309
- ),
1310
- );
1311
- validationSchemaStorage.registerOnce([registerCommonValidationSchemas]);
1312
- }
1313
- }