@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,651 +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 BulkCustomFieldOptionCreateRequest,
10
- type BulkCustomFieldOptionUpdateRequest,
11
- type CustomFieldCreatedContextOptionsList,
12
- type CustomFieldOption,
13
- type CustomFieldUpdatedContextOptionsList,
14
- type OrderOfCustomFieldOptions,
15
- type PageBeanCustomFieldContextOption,
16
- registerIssueCustomFieldOptionsValidationSchemas,
17
- } from "../models/issue-custom-field-options";
18
- import { validationSchemaStorage } from "../validation-schema-storage";
19
- /**
20
- * This resource represents custom issue field select list options created in Jira
21
- * or using the REST API. This resource supports the following field types:
22
- *
23
- * * Checkboxes.
24
- * * Radio Buttons.
25
- * * Select List (single choice).
26
- * * Select List (multiple choices).
27
- * * Select List (cascading).
28
- *
29
- * See [Issue custom field options
30
- * (apps)](#api-group-Issue-custom-field-options--apps-) to manipulate custom
31
- * issue field select list options created by a Connect app.
32
- *
33
- * Use it to retrieve, create, update, order, and delete custom field options.
34
- */
35
- export class IssueCustomFieldOptionsService extends CommonHttpService {
36
- /**
37
- * Creates options and, where the custom select field is of the type Select List
38
- * (cascading), cascading options for a custom select field. The options are added
39
- * to a context of the field.
40
- *
41
- * The maximum number of options that can be created per request is 1000 and each
42
- * field can have a maximum of 10000 options.
43
- *
44
- * This operation works for custom field options created in Jira or the operations
45
- * from this resource. **To work with issue field select list options created for
46
- * Connect apps use the [Issue custom field options
47
- * (apps)](#api-group-issue-custom-field-options--apps-) operations.**
48
- *
49
- * **[Permissions](#permissions) required:** *Administer Jira* [global
50
- * permission](https://confluence.atlassian.com/x/x4dKLg).
51
- *
52
- * @returns Returned if the request is successful.
53
- *
54
- * example: {
55
- * "options": [
56
- * {
57
- * "disabled": false,
58
- * "id": "10001",
59
- * "value": "Scranton"
60
- * },
61
- * {
62
- * "disabled": true,
63
- * "id": "10002",
64
- * "optionId": "10000",
65
- * "value": "Manhattan"
66
- * },
67
- * {
68
- * "disabled": false,
69
- * "id": "10003",
70
- * "value": "The Electric City"
71
- * }
72
- * ]
73
- * }
74
- * @path {POST} /rest/api/3/field/{fieldId}/context/{contextId}/option
75
- * @scopes-current manage:jira-configuration
76
- * @scopes-beta read:field.option:jira, write:field.option:jira
77
- */
78
- createCustomFieldOption({
79
- fieldId,
80
- contextId,
81
- bulkCustomFieldOptionCreateRequest,
82
- }: {
83
- /** The ID of the custom field. */
84
- fieldId: string;
85
- /** The ID of the context. */
86
- contextId: number;
87
- /**
88
- * @example {
89
- * "options": [
90
- * {
91
- * "disabled": false,
92
- * "value": "Scranton"
93
- * },
94
- * {
95
- * "disabled": true,
96
- * "optionId": "10000",
97
- * "value": "Manhattan"
98
- * },
99
- * {
100
- * "disabled": false,
101
- * "value": "The Electric City"
102
- * }
103
- * ]
104
- * }
105
- */
106
- bulkCustomFieldOptionCreateRequest: BulkCustomFieldOptionCreateRequest;
107
- }): Promise<CustomFieldCreatedContextOptionsList> {
108
- return this.getClientInstance()
109
- .request({
110
- path: "/rest/api/3/field/{fieldId}/context/{contextId}/option",
111
- method: "POST",
112
- pathParams: {
113
- fieldId,
114
- contextId,
115
- },
116
- headers: {
117
- "Content-Type": "application/json",
118
- },
119
- body: bulkCustomFieldOptionCreateRequest,
120
- })
121
- .then(
122
- this.getClientInstance().responseHandler({
123
- 200: {
124
- "application/json": "json",
125
- },
126
- }),
127
- )
128
- .then(
129
- commonHttpClient.castResponse<{
130
- status: 200;
131
- mediaType: "application/json";
132
- body: CustomFieldCreatedContextOptionsList;
133
- }>(),
134
- )
135
- .then(
136
- validationSchemaStorage.validator(
137
- "IssueCustomFieldOptionsService.createCustomFieldOption.response",
138
- ),
139
- )
140
- .then(commonHttpClient.getBody);
141
- }
142
- /**
143
- * Deletes a custom field option.
144
- *
145
- * Options with cascading options cannot be deleted without deleting the cascading
146
- * options first.
147
- *
148
- * This operation works for custom field options created in Jira or the operations
149
- * from this resource. **To work with issue field select list options created for
150
- * Connect apps use the [Issue custom field options
151
- * (apps)](#api-group-issue-custom-field-options--apps-) operations.**
152
- *
153
- * **[Permissions](#permissions) required:** *Administer Jira* [global
154
- * permission](https://confluence.atlassian.com/x/x4dKLg).
155
- *
156
- * @path {DELETE} /rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId}
157
- * @scopes-current manage:jira-configuration
158
- * @scopes-beta delete:field.option:jira
159
- */
160
- deleteCustomFieldOption({
161
- fieldId,
162
- contextId,
163
- optionId,
164
- }: {
165
- /** The ID of the custom field. */
166
- fieldId: string;
167
- /** The ID of the context from which an option should be deleted. */
168
- contextId: number;
169
- /** The ID of the option to delete. */
170
- optionId: number;
171
- }): Promise<void> {
172
- return this.getClientInstance()
173
- .request({
174
- path: "/rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId}",
175
- method: "DELETE",
176
- pathParams: {
177
- fieldId,
178
- contextId,
179
- optionId,
180
- },
181
- })
182
- .then(commonHttpClient.discardResult);
183
- }
184
- /**
185
- * Returns a custom field option. For example, an option in a select list.
186
- *
187
- * Note that this operation **only works for issue field select list options
188
- * created in Jira or using operations from the [Issue custom field
189
- * options](#api-group-Issue-custom-field-options) resource**, it cannot be used
190
- * with issue field select list options created by Connect apps.
191
- *
192
- * This operation can be accessed anonymously.
193
- *
194
- * **[Permissions](#permissions) required:** The custom field option is returned
195
- * as follows:
196
- *
197
- * * if the user has the *Administer Jira* [global
198
- * permission](https://confluence.atlassian.com/x/x4dKLg).
199
- * * if the user has the *Browse projects* [project
200
- * permission](https://confluence.atlassian.com/x/yodKLg) for at least one project
201
- * the custom field is used in, and the field is visible in at least one layout
202
- * the user has permission to view.
203
- *
204
- * @returns Returned if the request is successful.
205
- *
206
- * example: {
207
- * "self":
208
- * "https://your-domain.atlassian.net/rest/api/3/customFieldOption/10000",
209
- * "value": "To Do"
210
- * }
211
- * @path {GET} /rest/api/3/customFieldOption/{id}
212
- * @scopes-current read:jira-work
213
- * @scopes-beta read:field:jira, read:field.option:jira
214
- */
215
- getCustomFieldOption({
216
- id,
217
- }: {
218
- /** The ID of the custom field option. */
219
- id: string;
220
- }): Promise<CustomFieldOption> {
221
- return this.getClientInstance()
222
- .request({
223
- path: "/rest/api/3/customFieldOption/{id}",
224
- method: "GET",
225
- pathParams: {
226
- id,
227
- },
228
- })
229
- .then(
230
- this.getClientInstance().responseHandler({
231
- 200: {
232
- "application/json": "json",
233
- },
234
- }),
235
- )
236
- .then(
237
- commonHttpClient.castResponse<{
238
- status: 200;
239
- mediaType: "application/json";
240
- body: CustomFieldOption;
241
- }>(),
242
- )
243
- .then(
244
- validationSchemaStorage.validator(
245
- "IssueCustomFieldOptionsService.getCustomFieldOption.response",
246
- ),
247
- )
248
- .then(commonHttpClient.getBody);
249
- }
250
- /**
251
- * Returns a [paginated](#pagination) list of all custom field option for a
252
- * context. Options are returned first then cascading options, in the order they
253
- * display in Jira.
254
- *
255
- * This operation works for custom field options created in Jira or the operations
256
- * from this resource. **To work with issue field select list options created for
257
- * Connect apps use the [Issue custom field options
258
- * (apps)](#api-group-issue-custom-field-options--apps-) operations.**
259
- *
260
- * **[Permissions](#permissions) required:** *Administer Jira* [global
261
- * permission](https://confluence.atlassian.com/x/x4dKLg).
262
- *
263
- * @returns Returned if the request is successful.
264
- *
265
- * example: {
266
- * "isLast": true,
267
- * "maxResults": 100,
268
- * "startAt": 0,
269
- * "total": 4,
270
- * "values": [
271
- * {
272
- * "id": "10001",
273
- * "value": "New York"
274
- * },
275
- * {
276
- * "id": "10002",
277
- * "value": "Boston",
278
- * "disabled": true
279
- * },
280
- * {
281
- * "id": "10004",
282
- * "value": "Denver"
283
- * },
284
- * {
285
- * "id": "10003",
286
- * "value": "Brooklyn",
287
- * "optionId": "10001"
288
- * }
289
- * ]
290
- * }
291
- * @path {GET} /rest/api/3/field/{fieldId}/context/{contextId}/option
292
- * @scopes-current manage:jira-configuration
293
- * @scopes-beta read:field.option:jira
294
- */
295
- getOptionsForContext({
296
- fieldId,
297
- contextId,
298
- optionId,
299
- onlyOptions,
300
- startAt,
301
- maxResults,
302
- }: {
303
- /** The ID of the custom field. */
304
- fieldId: string;
305
- /** The ID of the context. */
306
- contextId: number;
307
- /** The ID of the option. */
308
- optionId?: number;
309
- /** Whether only options are returned. */
310
- onlyOptions?: boolean;
311
- /** The index of the first item to return in a page of results (page offset). */
312
- startAt?: number;
313
- /** The maximum number of items to return per page. */
314
- maxResults?: number;
315
- }): Promise<PageBeanCustomFieldContextOption> {
316
- return this.getClientInstance()
317
- .request({
318
- path: "/rest/api/3/field/{fieldId}/context/{contextId}/option",
319
- method: "GET",
320
- pathParams: {
321
- fieldId,
322
- contextId,
323
- },
324
- query: {
325
- optionId,
326
- onlyOptions,
327
- startAt,
328
- maxResults,
329
- },
330
- })
331
- .then(
332
- this.getClientInstance().responseHandler({
333
- 200: {
334
- "application/json": "json",
335
- },
336
- }),
337
- )
338
- .then(
339
- commonHttpClient.castResponse<{
340
- status: 200;
341
- mediaType: "application/json";
342
- body: PageBeanCustomFieldContextOption;
343
- }>(),
344
- )
345
- .then(
346
- validationSchemaStorage.validator(
347
- "IssueCustomFieldOptionsService.getOptionsForContext.response",
348
- ),
349
- )
350
- .then(commonHttpClient.getBody);
351
- }
352
- /**
353
- * Changes the order of custom field options or cascading options in a context.
354
- *
355
- * This operation works for custom field options created in Jira or the operations
356
- * from this resource. **To work with issue field select list options created for
357
- * Connect apps use the [Issue custom field options
358
- * (apps)](#api-group-issue-custom-field-options--apps-) operations.**
359
- *
360
- * **[Permissions](#permissions) required:** *Administer Jira* [global
361
- * permission](https://confluence.atlassian.com/x/x4dKLg).
362
- *
363
- * @returns Returned if options are reordered.
364
- * @path {PUT} /rest/api/3/field/{fieldId}/context/{contextId}/option/move
365
- * @scopes-current manage:jira-configuration
366
- * @scopes-beta write:field.option:jira
367
- */
368
- reorderCustomFieldOptions({
369
- fieldId,
370
- contextId,
371
- orderOfCustomFieldOptions,
372
- }: {
373
- /** The ID of the custom field. */
374
- fieldId: string;
375
- /** The ID of the context. */
376
- contextId: number;
377
- /**
378
- * @example {
379
- * "customFieldOptionIds": [
380
- * "10001",
381
- * "10002"
382
- * ],
383
- * "position": "First"
384
- * }
385
- */
386
- orderOfCustomFieldOptions: OrderOfCustomFieldOptions;
387
- }): Promise<void> {
388
- return this.getClientInstance()
389
- .request({
390
- path: "/rest/api/3/field/{fieldId}/context/{contextId}/option/move",
391
- method: "PUT",
392
- pathParams: {
393
- fieldId,
394
- contextId,
395
- },
396
- headers: {
397
- "Content-Type": "application/json",
398
- },
399
- body: orderOfCustomFieldOptions,
400
- })
401
- .then(
402
- this.getClientInstance().responseHandler({
403
- 204: {
404
- "application/json": "json",
405
- },
406
- }),
407
- )
408
- .then(
409
- commonHttpClient.castResponse<{
410
- status: 204;
411
- mediaType: "application/json";
412
- body: void;
413
- }>(),
414
- )
415
- .then(
416
- validationSchemaStorage.validator(
417
- "IssueCustomFieldOptionsService.reorderCustomFieldOptions.response",
418
- ),
419
- )
420
- .then(commonHttpClient.getBody);
421
- }
422
- /**
423
- * Replaces the options of a custom field.
424
- *
425
- * Note that this operation **only works for issue field select list options
426
- * created in Jira or using operations from the [Issue custom field
427
- * options](#api-group-Issue-custom-field-options) resource**, it cannot be used
428
- * with issue field select list options created by Connect or Forge apps.
429
- *
430
- * **[Permissions](#permissions) required:** *Administer Jira* [global
431
- * permission](https://confluence.atlassian.com/x/x4dKLg).
432
- *
433
- * @path {DELETE} /rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId}/issue
434
- * @scopes-current manage:jira-configuration
435
- * @scopes-beta read:field.option:jira, write:field.option:jira
436
- */
437
- replaceCustomFieldOption({
438
- fieldId,
439
- optionId,
440
- contextId,
441
- replaceWith,
442
- jql,
443
- }: {
444
- /** The ID of the custom field. */
445
- fieldId: string;
446
- /** The ID of the option to be deselected. */
447
- optionId: number;
448
- /** The ID of the context. */
449
- contextId: number;
450
- /** The ID of the option that will replace the currently selected option. */
451
- replaceWith?: number;
452
- /**
453
- * A JQL query that specifies the issues to be updated. For example,
454
- * *project=10000*.
455
- */
456
- jql?: string;
457
- }): Promise<void> {
458
- return this.getClientInstance()
459
- .request({
460
- path: "/rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId}/issue",
461
- method: "DELETE",
462
- pathParams: {
463
- fieldId,
464
- optionId,
465
- contextId,
466
- },
467
- query: {
468
- replaceWith,
469
- jql,
470
- },
471
- })
472
- .then(commonHttpClient.discardResult);
473
- }
474
- /**
475
- * Updates the options of a custom field.
476
- *
477
- * If any of the options are not found, no options are updated. Options where the
478
- * values in the request match the current values aren't updated and aren't
479
- * reported in the response.
480
- *
481
- * Note that this operation **only works for issue field select list options
482
- * created in Jira or using operations from the [Issue custom field
483
- * options](#api-group-Issue-custom-field-options) resource**, it cannot be used
484
- * with issue field select list options created by Connect apps.
485
- *
486
- * **[Permissions](#permissions) required:** *Administer Jira* [global
487
- * permission](https://confluence.atlassian.com/x/x4dKLg).
488
- *
489
- * @returns Returned if the request is successful.
490
- *
491
- * example: {
492
- * "options": [
493
- * {
494
- * "disabled": false,
495
- * "id": "10001",
496
- * "value": "Scranton"
497
- * },
498
- * {
499
- * "disabled": true,
500
- * "id": "10002",
501
- * "value": "Manhattan"
502
- * },
503
- * {
504
- * "disabled": false,
505
- * "id": "10003",
506
- * "value": "The Electric City"
507
- * }
508
- * ]
509
- * }
510
- * @path {PUT} /rest/api/3/field/{fieldId}/context/{contextId}/option
511
- * @scopes-current manage:jira-configuration
512
- * @scopes-beta read:field.option:jira, write:field.option:jira
513
- */
514
- updateCustomFieldOption({
515
- fieldId,
516
- contextId,
517
- bulkCustomFieldOptionUpdateRequest,
518
- }: {
519
- /** The ID of the custom field. */
520
- fieldId: string;
521
- /** The ID of the context. */
522
- contextId: number;
523
- /**
524
- * @example {
525
- * "options": [
526
- * {
527
- * "disabled": false,
528
- * "id": "10001",
529
- * "value": "Scranton"
530
- * },
531
- * {
532
- * "disabled": true,
533
- * "id": "10002",
534
- * "value": "Manhattan"
535
- * },
536
- * {
537
- * "disabled": false,
538
- * "id": "10003",
539
- * "value": "The Electric City"
540
- * }
541
- * ]
542
- * }
543
- */
544
- bulkCustomFieldOptionUpdateRequest: BulkCustomFieldOptionUpdateRequest;
545
- }): Promise<CustomFieldUpdatedContextOptionsList> {
546
- return this.getClientInstance()
547
- .request({
548
- path: "/rest/api/3/field/{fieldId}/context/{contextId}/option",
549
- method: "PUT",
550
- pathParams: {
551
- fieldId,
552
- contextId,
553
- },
554
- headers: {
555
- "Content-Type": "application/json",
556
- },
557
- body: bulkCustomFieldOptionUpdateRequest,
558
- })
559
- .then(
560
- this.getClientInstance().responseHandler({
561
- 200: {
562
- "application/json": "json",
563
- },
564
- }),
565
- )
566
- .then(
567
- commonHttpClient.castResponse<{
568
- status: 200;
569
- mediaType: "application/json";
570
- body: CustomFieldUpdatedContextOptionsList;
571
- }>(),
572
- )
573
- .then(
574
- validationSchemaStorage.validator(
575
- "IssueCustomFieldOptionsService.updateCustomFieldOption.response",
576
- ),
577
- )
578
- .then(commonHttpClient.getBody);
579
- }
580
- static initialize() {
581
- validationSchemaStorage.registerExtensible(
582
- "IssueCustomFieldOptionsService.getCustomFieldOption.response",
583
- z
584
- .object({
585
- status: z.literal(200),
586
- mediaType: z.literal("application/json"),
587
- body: validationSchemaStorage.lazy("CustomFieldOption"),
588
- })
589
- .describe(
590
- "IssueCustomFieldOptionsService.getCustomFieldOption.response",
591
- ),
592
- );
593
- validationSchemaStorage.registerExtensible(
594
- "IssueCustomFieldOptionsService.getOptionsForContext.response",
595
- z
596
- .object({
597
- status: z.literal(200),
598
- mediaType: z.literal("application/json"),
599
- body: validationSchemaStorage.lazy(
600
- "PageBeanCustomFieldContextOption",
601
- ),
602
- })
603
- .describe(
604
- "IssueCustomFieldOptionsService.getOptionsForContext.response",
605
- ),
606
- );
607
- validationSchemaStorage.registerExtensible(
608
- "IssueCustomFieldOptionsService.updateCustomFieldOption.response",
609
- z
610
- .object({
611
- status: z.literal(200),
612
- mediaType: z.literal("application/json"),
613
- body: validationSchemaStorage.lazy(
614
- "CustomFieldUpdatedContextOptionsList",
615
- ),
616
- })
617
- .describe(
618
- "IssueCustomFieldOptionsService.updateCustomFieldOption.response",
619
- ),
620
- );
621
- validationSchemaStorage.registerExtensible(
622
- "IssueCustomFieldOptionsService.createCustomFieldOption.response",
623
- z
624
- .object({
625
- status: z.literal(200),
626
- mediaType: z.literal("application/json"),
627
- body: validationSchemaStorage.lazy(
628
- "CustomFieldCreatedContextOptionsList",
629
- ),
630
- })
631
- .describe(
632
- "IssueCustomFieldOptionsService.createCustomFieldOption.response",
633
- ),
634
- );
635
- validationSchemaStorage.registerExtensible(
636
- "IssueCustomFieldOptionsService.reorderCustomFieldOptions.response",
637
- z
638
- .object({
639
- status: z.literal(204),
640
- mediaType: z.literal("application/json"),
641
- body: z.unknown(),
642
- })
643
- .describe(
644
- "IssueCustomFieldOptionsService.reorderCustomFieldOptions.response",
645
- ),
646
- );
647
- validationSchemaStorage.registerOnce([
648
- registerIssueCustomFieldOptionsValidationSchemas,
649
- ]);
650
- }
651
- }