@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.
- package/CHANGELOG.md +22 -0
- package/package.json +10 -3
- package/.eslintrc.js +0 -3
- package/config/api-typescript-generator.config.ts +0 -91
- package/config/compare-schemas.ts +0 -307
- package/src/index.ts +0 -47
- package/src/openapi/platform/base-jira-platform-api-client.ts +0 -2298
- package/src/openapi/platform/core/common-http-client.ts +0 -723
- package/src/openapi/platform/core/common-http-service.ts +0 -22
- package/src/openapi/platform/core/common-validation-schema-storage.ts +0 -105
- package/src/openapi/platform/models/announcement-banner.ts +0 -59
- package/src/openapi/platform/models/app-data-policies.ts +0 -79
- package/src/openapi/platform/models/app-migration.ts +0 -172
- package/src/openapi/platform/models/app-properties.ts +0 -32
- package/src/openapi/platform/models/audit-records.ts +0 -140
- package/src/openapi/platform/models/avatars.ts +0 -48
- package/src/openapi/platform/models/classification-levels.ts +0 -58
- package/src/openapi/platform/models/common.ts +0 -2669
- package/src/openapi/platform/models/dashboards.ts +0 -849
- package/src/openapi/platform/models/dynamic-modules.ts +0 -121
- package/src/openapi/platform/models/filter-sharing.ts +0 -103
- package/src/openapi/platform/models/filters.ts +0 -319
- package/src/openapi/platform/models/group-and-user-picker.ts +0 -85
- package/src/openapi/platform/models/groups.ts +0 -247
- package/src/openapi/platform/models/issue-attachments.ts +0 -290
- package/src/openapi/platform/models/issue-comment-properties.ts +0 -27
- package/src/openapi/platform/models/issue-comments.ts +0 -91
- package/src/openapi/platform/models/issue-custom-field-configuration-apps.ts +0 -96
- package/src/openapi/platform/models/issue-custom-field-contexts.ts +0 -1072
- package/src/openapi/platform/models/issue-custom-field-options-apps.ts +0 -273
- package/src/openapi/platform/models/issue-custom-field-options.ts +0 -283
- package/src/openapi/platform/models/issue-custom-field-values-apps.ts +0 -118
- package/src/openapi/platform/models/issue-field-configurations.ts +0 -435
- package/src/openapi/platform/models/issue-fields.ts +0 -392
- package/src/openapi/platform/models/issue-link-types.ts +0 -28
- package/src/openapi/platform/models/issue-links.ts +0 -185
- package/src/openapi/platform/models/issue-notification-schemes.ts +0 -370
- package/src/openapi/platform/models/issue-priorities.ts +0 -196
- package/src/openapi/platform/models/issue-properties.ts +0 -259
- package/src/openapi/platform/models/issue-remote-links.ts +0 -207
- package/src/openapi/platform/models/issue-resolutions.ts +0 -180
- package/src/openapi/platform/models/issue-search.ts +0 -367
- package/src/openapi/platform/models/issue-security-level.ts +0 -76
- package/src/openapi/platform/models/issue-security-schemes.ts +0 -496
- package/src/openapi/platform/models/issue-type-schemes.ts +0 -290
- package/src/openapi/platform/models/issue-type-screen-schemes.ts +0 -286
- package/src/openapi/platform/models/issue-types.ts +0 -66
- package/src/openapi/platform/models/issue-votes.ts +0 -38
- package/src/openapi/platform/models/issue-watchers.ts +0 -67
- package/src/openapi/platform/models/issue-worklogs.ts +0 -190
- package/src/openapi/platform/models/issues.ts +0 -1268
- package/src/openapi/platform/models/jira-expressions.ts +0 -578
- package/src/openapi/platform/models/jira-settings.ts +0 -118
- package/src/openapi/platform/models/jql-functions-apps.ts +0 -128
- package/src/openapi/platform/models/jql.ts +0 -783
- package/src/openapi/platform/models/labels.ts +0 -42
- package/src/openapi/platform/models/license-metrics.ts +0 -68
- package/src/openapi/platform/models/myself.ts +0 -29
- package/src/openapi/platform/models/permission-schemes.ts +0 -89
- package/src/openapi/platform/models/permissions.ts +0 -308
- package/src/openapi/platform/models/priority-schemes.ts +0 -527
- package/src/openapi/platform/models/project-avatars.ts +0 -29
- package/src/openapi/platform/models/project-classification-levels.ts +0 -24
- package/src/openapi/platform/models/project-components.ts +0 -231
- package/src/openapi/platform/models/project-email.ts +0 -27
- package/src/openapi/platform/models/project-features.ts +0 -78
- package/src/openapi/platform/models/project-permission-schemes.ts +0 -43
- package/src/openapi/platform/models/project-role-actors.ts +0 -107
- package/src/openapi/platform/models/project-roles.ts +0 -76
- package/src/openapi/platform/models/project-types.ts +0 -36
- package/src/openapi/platform/models/project-versions.ts +0 -216
- package/src/openapi/platform/models/projects.ts +0 -429
- package/src/openapi/platform/models/screen-schemes.ts +0 -192
- package/src/openapi/platform/models/screen-tab-fields.ts +0 -45
- package/src/openapi/platform/models/screens.ts +0 -171
- package/src/openapi/platform/models/server-info.ts +0 -100
- package/src/openapi/platform/models/service-registry.ts +0 -68
- package/src/openapi/platform/models/status.ts +0 -229
- package/src/openapi/platform/models/time-tracking.ts +0 -38
- package/src/openapi/platform/models/ui-modifications-apps.ts +0 -229
- package/src/openapi/platform/models/user-search.ts +0 -69
- package/src/openapi/platform/models/users.ts +0 -121
- package/src/openapi/platform/models/webhooks.ts +0 -307
- package/src/openapi/platform/models/workflow-scheme-drafts.ts +0 -58
- package/src/openapi/platform/models/workflow-scheme-project-associations.ts +0 -68
- package/src/openapi/platform/models/workflow-schemes.ts +0 -545
- package/src/openapi/platform/models/workflow-transition-properties.ts +0 -33
- package/src/openapi/platform/models/workflow-transition-rules.ts +0 -261
- package/src/openapi/platform/models/workflows.ts +0 -1943
- package/src/openapi/platform/services/announcement-banner-service.ts +0 -142
- package/src/openapi/platform/services/app-data-policies-service.ts +0 -136
- package/src/openapi/platform/services/app-migration-service.ts +0 -289
- package/src/openapi/platform/services/app-properties-service.ts +0 -441
- package/src/openapi/platform/services/application-roles-service.ts +0 -247
- package/src/openapi/platform/services/audit-records-service.ts +0 -164
- package/src/openapi/platform/services/avatars-service.ts +0 -769
- package/src/openapi/platform/services/classification-levels-service.ts +0 -131
- package/src/openapi/platform/services/dashboards-service.ts +0 -1721
- package/src/openapi/platform/services/dynamic-modules-service.ts +0 -127
- package/src/openapi/platform/services/filter-sharing-service.ts +0 -687
- package/src/openapi/platform/services/filters-service.ts +0 -1901
- package/src/openapi/platform/services/group-and-user-picker-service.ts +0 -224
- package/src/openapi/platform/services/groups-service.ts +0 -751
- package/src/openapi/platform/services/issue-attachments-service.ts +0 -900
- package/src/openapi/platform/services/issue-comment-properties-service.ts +0 -324
- package/src/openapi/platform/services/issue-comments-service.ts +0 -812
- package/src/openapi/platform/services/issue-custom-field-configuration-apps-service.ts +0 -277
- package/src/openapi/platform/services/issue-custom-field-contexts-service.ts +0 -1339
- package/src/openapi/platform/services/issue-custom-field-options-apps-service.ts +0 -994
- package/src/openapi/platform/services/issue-custom-field-options-service.ts +0 -651
- package/src/openapi/platform/services/issue-custom-field-values-apps-service.ts +0 -201
- package/src/openapi/platform/services/issue-field-configurations-service.ts +0 -1294
- package/src/openapi/platform/services/issue-fields-service.ts +0 -837
- package/src/openapi/platform/services/issue-link-types-service.ts +0 -360
- package/src/openapi/platform/services/issue-links-service.ts +0 -345
- package/src/openapi/platform/services/issue-navigator-settings-service.ts +0 -119
- package/src/openapi/platform/services/issue-notification-schemes-service.ts +0 -1209
- package/src/openapi/platform/services/issue-priorities-service.ts +0 -575
- package/src/openapi/platform/services/issue-properties-service.ts +0 -606
- package/src/openapi/platform/services/issue-remote-links-service.ts +0 -597
- package/src/openapi/platform/services/issue-resolutions-service.ts +0 -534
- package/src/openapi/platform/services/issue-search-service.ts +0 -1139
- package/src/openapi/platform/services/issue-security-level-service.ts +0 -250
- package/src/openapi/platform/services/issue-security-schemes-service.ts +0 -1240
- package/src/openapi/platform/services/issue-type-properties-service.ts +0 -325
- package/src/openapi/platform/services/issue-type-schemes-service.ts +0 -940
- package/src/openapi/platform/services/issue-type-screen-schemes-service.ts +0 -994
- package/src/openapi/platform/services/issue-types-service.ts +0 -679
- package/src/openapi/platform/services/issue-votes-service.ts +0 -221
- package/src/openapi/platform/services/issue-watchers-service.ts +0 -331
- package/src/openapi/platform/services/issue-worklog-properties-service.ts +0 -348
- package/src/openapi/platform/services/issue-worklogs-service.ts +0 -1089
- package/src/openapi/platform/services/issues-service.ts +0 -3346
- package/src/openapi/platform/services/jira-expressions-service.ts +0 -407
- package/src/openapi/platform/services/jira-settings-service.ts +0 -415
- package/src/openapi/platform/services/jql-functions-apps-service.ts +0 -219
- package/src/openapi/platform/services/jql-service.ts +0 -896
- package/src/openapi/platform/services/labels-service.ts +0 -89
- package/src/openapi/platform/services/license-metrics-service.ts +0 -216
- package/src/openapi/platform/services/myself-service.ts +0 -520
- package/src/openapi/platform/services/permission-schemes-service.ts +0 -926
- package/src/openapi/platform/services/permissions-service.ts +0 -407
- package/src/openapi/platform/services/priority-schemes-service.ts +0 -1001
- package/src/openapi/platform/services/project-avatars-service.ts +0 -341
- package/src/openapi/platform/services/project-categories-service.ts +0 -318
- package/src/openapi/platform/services/project-classification-levels-service.ts +0 -232
- package/src/openapi/platform/services/project-components-service.ts +0 -1332
- package/src/openapi/platform/services/project-email-service.ts +0 -161
- package/src/openapi/platform/services/project-features-service.ts +0 -207
- package/src/openapi/platform/services/project-key-and-name-validation-service.ts +0 -200
- package/src/openapi/platform/services/project-permission-schemes-service.ts +0 -384
- package/src/openapi/platform/services/project-properties-service.ts +0 -320
- package/src/openapi/platform/services/project-role-actors-service.ts +0 -627
- package/src/openapi/platform/services/project-roles-service.ts +0 -867
- package/src/openapi/platform/services/project-types-service.ts +0 -297
- package/src/openapi/platform/services/project-versions-service.ts +0 -1287
- package/src/openapi/platform/services/projects-service.ts +0 -2196
- package/src/openapi/platform/services/screen-schemes-service.ts +0 -334
- package/src/openapi/platform/services/screen-tab-fields-service.ts +0 -276
- package/src/openapi/platform/services/screen-tabs-service.ts +0 -421
- package/src/openapi/platform/services/screens-service.ts +0 -528
- package/src/openapi/platform/services/server-info-service.ts +0 -88
- package/src/openapi/platform/services/service-registry-service.ts +0 -89
- package/src/openapi/platform/services/status-service.ts +0 -498
- package/src/openapi/platform/services/tasks-service.ts +0 -159
- package/src/openapi/platform/services/time-tracking-service.ts +0 -386
- package/src/openapi/platform/services/ui-modifications-apps-service.ts +0 -403
- package/src/openapi/platform/services/user-properties-service.ts +0 -413
- package/src/openapi/platform/services/user-search-service.ts +0 -1214
- package/src/openapi/platform/services/users-service.ts +0 -1108
- package/src/openapi/platform/services/webhooks-service.ts +0 -458
- package/src/openapi/platform/services/workflow-scheme-drafts-service.ts +0 -1313
- package/src/openapi/platform/services/workflow-scheme-project-associations-service.ts +0 -189
- package/src/openapi/platform/services/workflow-schemes-service.ts +0 -1617
- package/src/openapi/platform/services/workflow-status-categories-service.ts +0 -151
- package/src/openapi/platform/services/workflow-statuses-service.ts +0 -176
- package/src/openapi/platform/services/workflow-transition-properties-service.ts +0 -388
- package/src/openapi/platform/services/workflow-transition-rules-service.ts +0 -485
- package/src/openapi/platform/services/workflows-service.ts +0 -3477
- package/src/openapi/platform/validation-schema-storage.ts +0 -186
- package/src/openapi/software/base-jira-software-api-client.ts +0 -447
- package/src/openapi/software/core/common-http-client.ts +0 -723
- package/src/openapi/software/core/common-http-service.ts +0 -22
- package/src/openapi/software/core/common-validation-schema-storage.ts +0 -105
- package/src/openapi/software/models/board.ts +0 -918
- package/src/openapi/software/services/backlog-service.ts +0 -160
- package/src/openapi/software/services/board-service.ts +0 -4189
- package/src/openapi/software/services/builds-service.ts +0 -571
- package/src/openapi/software/services/deployments-service.ts +0 -403
- package/src/openapi/software/services/dev-ops-components-service.ts +0 -371
- package/src/openapi/software/services/development-information-service.ts +0 -2357
- package/src/openapi/software/services/epic-service.ts +0 -854
- package/src/openapi/software/services/feature-flags-service.ts +0 -303
- package/src/openapi/software/services/issue-service.ts +0 -529
- package/src/openapi/software/services/operations-service.ts +0 -741
- package/src/openapi/software/services/remote-links-service.ts +0 -653
- package/src/openapi/software/services/security-information-service.ts +0 -495
- package/src/openapi/software/services/sprint-service.ts +0 -969
- package/src/openapi/software/validation-schema-storage.ts +0 -186
- package/tsconfig.build.json +0 -7
- package/tsconfig.json +0 -4
|
@@ -1,896 +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 AutoCompleteSuggestions,
|
|
10
|
-
type ConvertedJqlQueries,
|
|
11
|
-
type JqlPersonalDataMigrationRequest,
|
|
12
|
-
type JqlQueriesToParse,
|
|
13
|
-
type JqlQueriesToSanitize,
|
|
14
|
-
type JqlReferenceData,
|
|
15
|
-
type ParsedJqlQueries,
|
|
16
|
-
registerJqlValidationSchemas,
|
|
17
|
-
type SanitizedJqlQueries,
|
|
18
|
-
type SearchAutoCompleteFilter,
|
|
19
|
-
} from "../models/jql";
|
|
20
|
-
import { validationSchemaStorage } from "../validation-schema-storage";
|
|
21
|
-
/**
|
|
22
|
-
* This resource represents JQL search auto-complete details. Use it to obtain JQL
|
|
23
|
-
* search auto-complete data and suggestions for use in programmatic construction
|
|
24
|
-
* of queries or custom query builders. It also provides operations to:
|
|
25
|
-
*
|
|
26
|
-
* * convert one or more JQL queries with user identifiers (username or user
|
|
27
|
-
* key) to equivalent JQL queries with account IDs.
|
|
28
|
-
* * convert readable details in one or more JQL queries to IDs where a user
|
|
29
|
-
* doesn't have permission to view the entity whose details are readable.
|
|
30
|
-
*/
|
|
31
|
-
export class JqlService extends CommonHttpService {
|
|
32
|
-
/**
|
|
33
|
-
* Returns reference data for JQL searches. This is a downloadable version of the
|
|
34
|
-
* documentation provided in [Advanced searching - fields
|
|
35
|
-
* reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching -
|
|
36
|
-
* functions reference](https://confluence.atlassian.com/x/hgORLQ), along with a
|
|
37
|
-
* list of JQL-reserved words. Use this information to assist with the
|
|
38
|
-
* programmatic creation of JQL queries or the validation of queries built in a
|
|
39
|
-
* custom query builder.
|
|
40
|
-
*
|
|
41
|
-
* To filter visible field details by project or collapse non-unique fields by
|
|
42
|
-
* field type then [Get field reference data
|
|
43
|
-
* (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used.
|
|
44
|
-
*
|
|
45
|
-
* This operation can be accessed anonymously.
|
|
46
|
-
*
|
|
47
|
-
* **[Permissions](#permissions) required:** None.
|
|
48
|
-
*
|
|
49
|
-
* @returns Returned if the request is successful.
|
|
50
|
-
*
|
|
51
|
-
* example: {
|
|
52
|
-
* "jqlReservedWords": [
|
|
53
|
-
* "empty",
|
|
54
|
-
* "and",
|
|
55
|
-
* "or",
|
|
56
|
-
* "in",
|
|
57
|
-
* "distinct"
|
|
58
|
-
* ],
|
|
59
|
-
* "visibleFieldNames": [
|
|
60
|
-
* {
|
|
61
|
-
* "displayName": "summary",
|
|
62
|
-
* "operators": [
|
|
63
|
-
* "~",
|
|
64
|
-
* "!~",
|
|
65
|
-
* "is",
|
|
66
|
-
* "is not"
|
|
67
|
-
* ],
|
|
68
|
-
* "orderable": "true",
|
|
69
|
-
* "searchable": "true",
|
|
70
|
-
* "types": [
|
|
71
|
-
* "java.lang.String"
|
|
72
|
-
* ],
|
|
73
|
-
* "value": "summary"
|
|
74
|
-
* },
|
|
75
|
-
* {
|
|
76
|
-
* "auto": "true",
|
|
77
|
-
* "cfid": "cf[10880]",
|
|
78
|
-
* "displayName": "Sprint - cf[10880]",
|
|
79
|
-
* "operators": [
|
|
80
|
-
* "=",
|
|
81
|
-
* "!=",
|
|
82
|
-
* "in",
|
|
83
|
-
* "not in",
|
|
84
|
-
* "is",
|
|
85
|
-
* "is not"
|
|
86
|
-
* ],
|
|
87
|
-
* "orderable": "true",
|
|
88
|
-
* "searchable": "true",
|
|
89
|
-
* "types": [
|
|
90
|
-
* "com.atlassian.greenhopper.service.sprint.Sprint"
|
|
91
|
-
* ],
|
|
92
|
-
* "value": "Sprint"
|
|
93
|
-
* }
|
|
94
|
-
* ],
|
|
95
|
-
* "visibleFunctionNames": [
|
|
96
|
-
* {
|
|
97
|
-
* "displayName": "standardIssueTypes()",
|
|
98
|
-
* "isList": "true",
|
|
99
|
-
* "types": [
|
|
100
|
-
* "com.atlassian.jira.issue.issuetype.IssueType"
|
|
101
|
-
* ],
|
|
102
|
-
* "value": "standardIssueTypes()"
|
|
103
|
-
* },
|
|
104
|
-
* {
|
|
105
|
-
* "displayName": "issuesWithText()",
|
|
106
|
-
* "supportsListAndSingleValueOperators": "true",
|
|
107
|
-
* "types": [
|
|
108
|
-
* "com.atlassian.jira.issue.issuetype.IssueType"
|
|
109
|
-
* ],
|
|
110
|
-
* "value": "issuesWithText()"
|
|
111
|
-
* }
|
|
112
|
-
* ]
|
|
113
|
-
* }
|
|
114
|
-
* @path {GET} /rest/api/3/jql/autocompletedata
|
|
115
|
-
* @scopes-current read:jira-work
|
|
116
|
-
* @scopes-beta read:field:jira
|
|
117
|
-
*/
|
|
118
|
-
getAutoComplete(): Promise<JqlReferenceData> {
|
|
119
|
-
return this.getClientInstance()
|
|
120
|
-
.request({
|
|
121
|
-
path: "/rest/api/3/jql/autocompletedata",
|
|
122
|
-
method: "GET",
|
|
123
|
-
})
|
|
124
|
-
.then(
|
|
125
|
-
this.getClientInstance().responseHandler({
|
|
126
|
-
200: {
|
|
127
|
-
"application/json": "json",
|
|
128
|
-
},
|
|
129
|
-
}),
|
|
130
|
-
)
|
|
131
|
-
.then(
|
|
132
|
-
commonHttpClient.castResponse<{
|
|
133
|
-
status: 200;
|
|
134
|
-
mediaType: "application/json";
|
|
135
|
-
body: JqlReferenceData;
|
|
136
|
-
}>(),
|
|
137
|
-
)
|
|
138
|
-
.then(
|
|
139
|
-
validationSchemaStorage.validator(
|
|
140
|
-
"JqlService.getAutoComplete.response",
|
|
141
|
-
),
|
|
142
|
-
)
|
|
143
|
-
.then(commonHttpClient.getBody);
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Returns reference data for JQL searches. This is a downloadable version of the
|
|
147
|
-
* documentation provided in [Advanced searching - fields
|
|
148
|
-
* reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching -
|
|
149
|
-
* functions reference](https://confluence.atlassian.com/x/hgORLQ), along with a
|
|
150
|
-
* list of JQL-reserved words. Use this information to assist with the
|
|
151
|
-
* programmatic creation of JQL queries or the validation of queries built in a
|
|
152
|
-
* custom query builder.
|
|
153
|
-
*
|
|
154
|
-
* This operation can filter the custom fields returned by project. Invalid
|
|
155
|
-
* project IDs in `projectIds` are ignored. System fields are always returned.
|
|
156
|
-
*
|
|
157
|
-
* It can also return the collapsed field for custom fields. Collapsed fields
|
|
158
|
-
* enable searches to be performed across all fields with the same name and of the
|
|
159
|
-
* same field type. For example, the collapsed field `Component -
|
|
160
|
-
* Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and
|
|
161
|
-
* `Component - cf[10062]` to be searched simultaneously.
|
|
162
|
-
*
|
|
163
|
-
* **[Permissions](#permissions) required:** None.
|
|
164
|
-
*
|
|
165
|
-
* @returns Returned if the request is successful.
|
|
166
|
-
*
|
|
167
|
-
* example: {
|
|
168
|
-
* "jqlReservedWords": [
|
|
169
|
-
* "empty",
|
|
170
|
-
* "and",
|
|
171
|
-
* "or",
|
|
172
|
-
* "in",
|
|
173
|
-
* "distinct"
|
|
174
|
-
* ],
|
|
175
|
-
* "visibleFieldNames": [
|
|
176
|
-
* {
|
|
177
|
-
* "displayName": "summary",
|
|
178
|
-
* "operators": [
|
|
179
|
-
* "~",
|
|
180
|
-
* "!~",
|
|
181
|
-
* "is",
|
|
182
|
-
* "is not"
|
|
183
|
-
* ],
|
|
184
|
-
* "orderable": "true",
|
|
185
|
-
* "searchable": "true",
|
|
186
|
-
* "types": [
|
|
187
|
-
* "java.lang.String"
|
|
188
|
-
* ],
|
|
189
|
-
* "value": "summary"
|
|
190
|
-
* },
|
|
191
|
-
* {
|
|
192
|
-
* "auto": "true",
|
|
193
|
-
* "cfid": "cf[10061]",
|
|
194
|
-
* "displayName": "Component - cf[10061]",
|
|
195
|
-
* "operators": [
|
|
196
|
-
* "=",
|
|
197
|
-
* "!=",
|
|
198
|
-
* "in",
|
|
199
|
-
* "not in",
|
|
200
|
-
* "is",
|
|
201
|
-
* "is not"
|
|
202
|
-
* ],
|
|
203
|
-
* "orderable": "true",
|
|
204
|
-
* "types": [
|
|
205
|
-
* "com.atlassian.jira.issue.customfields.option.Option"
|
|
206
|
-
* ],
|
|
207
|
-
* "value": "cf[10061]"
|
|
208
|
-
* },
|
|
209
|
-
* {
|
|
210
|
-
* "auto": "true",
|
|
211
|
-
* "cfid": "cf[10062]",
|
|
212
|
-
* "displayName": "Component - cf[10062]",
|
|
213
|
-
* "operators": [
|
|
214
|
-
* "=",
|
|
215
|
-
* "!=",
|
|
216
|
-
* "in",
|
|
217
|
-
* "not in",
|
|
218
|
-
* "is",
|
|
219
|
-
* "is not"
|
|
220
|
-
* ],
|
|
221
|
-
* "orderable": "true",
|
|
222
|
-
* "types": [
|
|
223
|
-
* "com.atlassian.jira.issue.customfields.option.Option"
|
|
224
|
-
* ],
|
|
225
|
-
* "value": "cf[10062]"
|
|
226
|
-
* },
|
|
227
|
-
* {
|
|
228
|
-
* "auto": "true",
|
|
229
|
-
* "displayName": "Component - Component[Dropdown]",
|
|
230
|
-
* "operators": [
|
|
231
|
-
* "=",
|
|
232
|
-
* "!=",
|
|
233
|
-
* "in",
|
|
234
|
-
* "not in",
|
|
235
|
-
* "is",
|
|
236
|
-
* "is not"
|
|
237
|
-
* ],
|
|
238
|
-
* "searchable": "true",
|
|
239
|
-
* "types": [
|
|
240
|
-
* "com.atlassian.jira.issue.customfields.option.Option"
|
|
241
|
-
* ],
|
|
242
|
-
* "value": "\"Component[Dropdown]\""
|
|
243
|
-
* }
|
|
244
|
-
* ],
|
|
245
|
-
* "visibleFunctionNames": [
|
|
246
|
-
* {
|
|
247
|
-
* "displayName": "standardIssueTypes()",
|
|
248
|
-
* "isList": "true",
|
|
249
|
-
* "types": [
|
|
250
|
-
* "com.atlassian.jira.issue.issuetype.IssueType"
|
|
251
|
-
* ],
|
|
252
|
-
* "value": "standardIssueTypes()"
|
|
253
|
-
* }
|
|
254
|
-
* ]
|
|
255
|
-
* }
|
|
256
|
-
* @path {POST} /rest/api/3/jql/autocompletedata
|
|
257
|
-
* @scopes-current read:jira-work
|
|
258
|
-
* @scopes-beta read:field:jira
|
|
259
|
-
*/
|
|
260
|
-
getAutoCompletePost({
|
|
261
|
-
searchAutoCompleteFilter,
|
|
262
|
-
}: {
|
|
263
|
-
/**
|
|
264
|
-
* @example {
|
|
265
|
-
* "includeCollapsedFields": true,
|
|
266
|
-
* "projectIds": [
|
|
267
|
-
* 10000,
|
|
268
|
-
* 10001,
|
|
269
|
-
* 10002
|
|
270
|
-
* ]
|
|
271
|
-
* }
|
|
272
|
-
*/
|
|
273
|
-
searchAutoCompleteFilter: SearchAutoCompleteFilter;
|
|
274
|
-
}): Promise<JqlReferenceData> {
|
|
275
|
-
return this.getClientInstance()
|
|
276
|
-
.request({
|
|
277
|
-
path: "/rest/api/3/jql/autocompletedata",
|
|
278
|
-
method: "POST",
|
|
279
|
-
headers: {
|
|
280
|
-
"Content-Type": "application/json",
|
|
281
|
-
},
|
|
282
|
-
body: searchAutoCompleteFilter,
|
|
283
|
-
})
|
|
284
|
-
.then(
|
|
285
|
-
this.getClientInstance().responseHandler({
|
|
286
|
-
200: {
|
|
287
|
-
"application/json": "json",
|
|
288
|
-
},
|
|
289
|
-
}),
|
|
290
|
-
)
|
|
291
|
-
.then(
|
|
292
|
-
commonHttpClient.castResponse<{
|
|
293
|
-
status: 200;
|
|
294
|
-
mediaType: "application/json";
|
|
295
|
-
body: JqlReferenceData;
|
|
296
|
-
}>(),
|
|
297
|
-
)
|
|
298
|
-
.then(
|
|
299
|
-
validationSchemaStorage.validator(
|
|
300
|
-
"JqlService.getAutoCompletePost.response",
|
|
301
|
-
),
|
|
302
|
-
)
|
|
303
|
-
.then(commonHttpClient.getBody);
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Returns the JQL search auto complete suggestions for a field.
|
|
307
|
-
*
|
|
308
|
-
* Suggestions can be obtained by providing:
|
|
309
|
-
*
|
|
310
|
-
* * `fieldName` to get a list of all values for the field.
|
|
311
|
-
* * `fieldName` and `fieldValue` to get a list of values containing the text in
|
|
312
|
-
* `fieldValue`.
|
|
313
|
-
* * `fieldName` and `predicateName` to get a list of all predicate values for
|
|
314
|
-
* the field.
|
|
315
|
-
* * `fieldName`, `predicateName`, and `predicateValue` to get a list of
|
|
316
|
-
* predicate values containing the text in `predicateValue`.
|
|
317
|
-
*
|
|
318
|
-
* This operation can be accessed anonymously.
|
|
319
|
-
*
|
|
320
|
-
* **[Permissions](#permissions) required:** None.
|
|
321
|
-
*
|
|
322
|
-
* @returns Returned if the request is successful.
|
|
323
|
-
*
|
|
324
|
-
* example: {
|
|
325
|
-
* "results": [
|
|
326
|
-
* {
|
|
327
|
-
* "displayName": "<b>Ac</b>tiveObjects (AO)",
|
|
328
|
-
* "value": "ActiveObjects"
|
|
329
|
-
* },
|
|
330
|
-
* {
|
|
331
|
-
* "displayName": "Atlassian Connect (<b>AC</b>)",
|
|
332
|
-
* "value": "Atlassian Connect"
|
|
333
|
-
* },
|
|
334
|
-
* {
|
|
335
|
-
* "displayName": "Atlassian Connect in Jira (<b>AC</b>JIRA)",
|
|
336
|
-
* "value": "Atlassian Connect in Jira"
|
|
337
|
-
* }
|
|
338
|
-
* ]
|
|
339
|
-
* }
|
|
340
|
-
* @path {GET} /rest/api/3/jql/autocompletedata/suggestions
|
|
341
|
-
* @scopes-current read:jira-work
|
|
342
|
-
* @scopes-beta read:issue-details:jira
|
|
343
|
-
*/
|
|
344
|
-
getFieldAutoCompleteForQueryString({
|
|
345
|
-
fieldName,
|
|
346
|
-
fieldValue,
|
|
347
|
-
predicateName,
|
|
348
|
-
predicateValue,
|
|
349
|
-
}: {
|
|
350
|
-
/** The name of the field. */
|
|
351
|
-
fieldName?: string;
|
|
352
|
-
/** The partial field item name entered by the user. */
|
|
353
|
-
fieldValue?: string;
|
|
354
|
-
/**
|
|
355
|
-
* The name of the [ CHANGED operator
|
|
356
|
-
* predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED)
|
|
357
|
-
* for which the suggestions are generated. The valid predicate operators are
|
|
358
|
-
* *by*, *from*, and *to*.
|
|
359
|
-
*/
|
|
360
|
-
predicateName?: string;
|
|
361
|
-
/** The partial predicate item name entered by the user. */
|
|
362
|
-
predicateValue?: string;
|
|
363
|
-
}): Promise<AutoCompleteSuggestions> {
|
|
364
|
-
return this.getClientInstance()
|
|
365
|
-
.request({
|
|
366
|
-
path: "/rest/api/3/jql/autocompletedata/suggestions",
|
|
367
|
-
method: "GET",
|
|
368
|
-
query: {
|
|
369
|
-
fieldName,
|
|
370
|
-
fieldValue,
|
|
371
|
-
predicateName,
|
|
372
|
-
predicateValue,
|
|
373
|
-
},
|
|
374
|
-
})
|
|
375
|
-
.then(
|
|
376
|
-
this.getClientInstance().responseHandler({
|
|
377
|
-
200: {
|
|
378
|
-
"application/json": "json",
|
|
379
|
-
},
|
|
380
|
-
}),
|
|
381
|
-
)
|
|
382
|
-
.then(
|
|
383
|
-
commonHttpClient.castResponse<{
|
|
384
|
-
status: 200;
|
|
385
|
-
mediaType: "application/json";
|
|
386
|
-
body: AutoCompleteSuggestions;
|
|
387
|
-
}>(),
|
|
388
|
-
)
|
|
389
|
-
.then(
|
|
390
|
-
validationSchemaStorage.validator(
|
|
391
|
-
"JqlService.getFieldAutoCompleteForQueryString.response",
|
|
392
|
-
),
|
|
393
|
-
)
|
|
394
|
-
.then(commonHttpClient.getBody);
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Converts one or more JQL queries with user identifiers (username or user key)
|
|
398
|
-
* to equivalent JQL queries with account IDs.
|
|
399
|
-
*
|
|
400
|
-
* You may wish to use this operation if your system stores JQL queries and you
|
|
401
|
-
* want to make them GDPR-compliant. For more information about GDPR-related
|
|
402
|
-
* changes, see the [migration
|
|
403
|
-
* guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/).
|
|
404
|
-
*
|
|
405
|
-
* **[Permissions](#permissions) required:** Permission to access Jira.
|
|
406
|
-
*
|
|
407
|
-
* @returns Returned if the request is successful. Note that the JQL queries are returned
|
|
408
|
-
* in the same order that they were passed.
|
|
409
|
-
*
|
|
410
|
-
* example: {
|
|
411
|
-
* "queriesWithUnknownUsers": [
|
|
412
|
-
* {
|
|
413
|
-
* "convertedQuery": "assignee = unknown",
|
|
414
|
-
* "originalQuery": "assignee = mia"
|
|
415
|
-
* }
|
|
416
|
-
* ],
|
|
417
|
-
* "queryStrings": [
|
|
418
|
-
* "issuetype = Bug AND assignee in (abcde-12345) AND reporter in
|
|
419
|
-
* (abc551-c4e99) order by lastViewed DESC"
|
|
420
|
-
* ]
|
|
421
|
-
* }
|
|
422
|
-
* @path {POST} /rest/api/3/jql/pdcleaner
|
|
423
|
-
* @scopes-current read:jira-user
|
|
424
|
-
* @scopes-beta read:user:jira, read:jql:jira, validate:jql:jira
|
|
425
|
-
*/
|
|
426
|
-
migrateQueries({
|
|
427
|
-
jqlPersonalDataMigrationRequest,
|
|
428
|
-
}: {
|
|
429
|
-
/**
|
|
430
|
-
* @example {
|
|
431
|
-
* "queryStrings": [
|
|
432
|
-
* "assignee = mia",
|
|
433
|
-
* "issuetype = Bug AND assignee in (mia) AND reporter in (alana) order by
|
|
434
|
-
* lastViewed DESC"
|
|
435
|
-
* ]
|
|
436
|
-
* }
|
|
437
|
-
*/
|
|
438
|
-
jqlPersonalDataMigrationRequest: JqlPersonalDataMigrationRequest;
|
|
439
|
-
}): Promise<ConvertedJqlQueries> {
|
|
440
|
-
return this.getClientInstance()
|
|
441
|
-
.request({
|
|
442
|
-
path: "/rest/api/3/jql/pdcleaner",
|
|
443
|
-
method: "POST",
|
|
444
|
-
headers: {
|
|
445
|
-
"Content-Type": "application/json",
|
|
446
|
-
},
|
|
447
|
-
body: jqlPersonalDataMigrationRequest,
|
|
448
|
-
})
|
|
449
|
-
.then(
|
|
450
|
-
this.getClientInstance().responseHandler({
|
|
451
|
-
200: {
|
|
452
|
-
"application/json": "json",
|
|
453
|
-
},
|
|
454
|
-
}),
|
|
455
|
-
)
|
|
456
|
-
.then(
|
|
457
|
-
commonHttpClient.castResponse<{
|
|
458
|
-
status: 200;
|
|
459
|
-
mediaType: "application/json";
|
|
460
|
-
body: ConvertedJqlQueries;
|
|
461
|
-
}>(),
|
|
462
|
-
)
|
|
463
|
-
.then(
|
|
464
|
-
validationSchemaStorage.validator("JqlService.migrateQueries.response"),
|
|
465
|
-
)
|
|
466
|
-
.then(commonHttpClient.getBody);
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Parses and validates JQL queries.
|
|
470
|
-
*
|
|
471
|
-
* Validation is performed in context of the current user.
|
|
472
|
-
*
|
|
473
|
-
* This operation can be accessed anonymously.
|
|
474
|
-
*
|
|
475
|
-
* **[Permissions](#permissions) required:** None.
|
|
476
|
-
*
|
|
477
|
-
* @returns Returned if the request is successful.
|
|
478
|
-
*
|
|
479
|
-
* example: {
|
|
480
|
-
* "queries": [
|
|
481
|
-
* {
|
|
482
|
-
* "query": "summary ~ test AND (labels in (urgent, blocker) OR
|
|
483
|
-
* lastCommentedBy = currentUser()) AND status CHANGED AFTER -5d ORDER BY updated
|
|
484
|
-
* DESC",
|
|
485
|
-
* "structure": {
|
|
486
|
-
* "orderBy": {
|
|
487
|
-
* "fields": [
|
|
488
|
-
* {
|
|
489
|
-
* "direction": "desc",
|
|
490
|
-
* "field": {
|
|
491
|
-
* "encodedName": "updated",
|
|
492
|
-
* "name": "updated"
|
|
493
|
-
* }
|
|
494
|
-
* }
|
|
495
|
-
* ]
|
|
496
|
-
* },
|
|
497
|
-
* "where": {
|
|
498
|
-
* "clauses": [
|
|
499
|
-
* {
|
|
500
|
-
* "field": {
|
|
501
|
-
* "encodedName": "summary",
|
|
502
|
-
* "name": "summary"
|
|
503
|
-
* },
|
|
504
|
-
* "operand": {
|
|
505
|
-
* "encodedValue": "test",
|
|
506
|
-
* "value": "test"
|
|
507
|
-
* },
|
|
508
|
-
* "operator": "~"
|
|
509
|
-
* },
|
|
510
|
-
* {
|
|
511
|
-
* "clauses": [
|
|
512
|
-
* {
|
|
513
|
-
* "field": {
|
|
514
|
-
* "encodedName": "labels",
|
|
515
|
-
* "name": "labels"
|
|
516
|
-
* },
|
|
517
|
-
* "operand": {
|
|
518
|
-
* "encodedOperand": "urgent, blocker)",
|
|
519
|
-
* "values": [
|
|
520
|
-
* {
|
|
521
|
-
* "encodedValue": "urgent",
|
|
522
|
-
* "value": "urgent"
|
|
523
|
-
* },
|
|
524
|
-
* {
|
|
525
|
-
* "encodedValue": "blocker",
|
|
526
|
-
* "value": "blocker"
|
|
527
|
-
* }
|
|
528
|
-
* ]
|
|
529
|
-
* },
|
|
530
|
-
* "operator": "in"
|
|
531
|
-
* },
|
|
532
|
-
* {
|
|
533
|
-
* "field": {
|
|
534
|
-
* "encodedName": "lastCommentedBy",
|
|
535
|
-
* "name": "lastCommentedBy",
|
|
536
|
-
* "property": [
|
|
537
|
-
* {
|
|
538
|
-
* "entity": "issue",
|
|
539
|
-
* "key": "propertyKey",
|
|
540
|
-
* "path": "path.in.property",
|
|
541
|
-
* "type": "user"
|
|
542
|
-
* }
|
|
543
|
-
* ]
|
|
544
|
-
* },
|
|
545
|
-
* "operand": {
|
|
546
|
-
* "arguments": [],
|
|
547
|
-
* "encodedOperand": "currentUser()",
|
|
548
|
-
* "function": "currentUser"
|
|
549
|
-
* },
|
|
550
|
-
* "operator": "="
|
|
551
|
-
* }
|
|
552
|
-
* ],
|
|
553
|
-
* "operator": "or"
|
|
554
|
-
* },
|
|
555
|
-
* {
|
|
556
|
-
* "field": {
|
|
557
|
-
* "encodedName": "status",
|
|
558
|
-
* "name": "status"
|
|
559
|
-
* },
|
|
560
|
-
* "operator": "changed",
|
|
561
|
-
* "predicates": [
|
|
562
|
-
* {
|
|
563
|
-
* "operand": {
|
|
564
|
-
* "arguments": [
|
|
565
|
-
* "-1M"
|
|
566
|
-
* ],
|
|
567
|
-
* "encodedOperand": "startOfMonth(-1M)",
|
|
568
|
-
* "function": "startOfMonth"
|
|
569
|
-
* },
|
|
570
|
-
* "operator": "after"
|
|
571
|
-
* }
|
|
572
|
-
* ]
|
|
573
|
-
* }
|
|
574
|
-
* ],
|
|
575
|
-
* "operator": "and"
|
|
576
|
-
* }
|
|
577
|
-
* }
|
|
578
|
-
* },
|
|
579
|
-
* {
|
|
580
|
-
* "query": "issue.property[\"spaces here\"].value in (\"Service requests\",
|
|
581
|
-
* Incidents)",
|
|
582
|
-
* "structure": {
|
|
583
|
-
* "where": {
|
|
584
|
-
* "field": {
|
|
585
|
-
* "encodedName": "issue.property[\"spaces here\"].value",
|
|
586
|
-
* "name": "issue.property[spaces here].value",
|
|
587
|
-
* "property": [
|
|
588
|
-
* {
|
|
589
|
-
* "entity": "issue",
|
|
590
|
-
* "key": "spaces here",
|
|
591
|
-
* "path": "value"
|
|
592
|
-
* }
|
|
593
|
-
* ]
|
|
594
|
-
* },
|
|
595
|
-
* "operand": {
|
|
596
|
-
* "encodedOperand": "(\"Service requests\", Incidents)",
|
|
597
|
-
* "values": [
|
|
598
|
-
* {
|
|
599
|
-
* "encodedValue": "\"Service requests\"",
|
|
600
|
-
* "value": "Service requests"
|
|
601
|
-
* },
|
|
602
|
-
* {
|
|
603
|
-
* "encodedValue": "Incidents",
|
|
604
|
-
* "value": "Incidents"
|
|
605
|
-
* }
|
|
606
|
-
* ]
|
|
607
|
-
* },
|
|
608
|
-
* "operator": "in"
|
|
609
|
-
* }
|
|
610
|
-
* }
|
|
611
|
-
* },
|
|
612
|
-
* {
|
|
613
|
-
* "errors": [
|
|
614
|
-
* "Error in the JQL Query: Expecting operator but got 'query'. The valid
|
|
615
|
-
* operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS'
|
|
616
|
-
* and 'IS NOT'. (line 1, character 9)"
|
|
617
|
-
* ],
|
|
618
|
-
* "query": "invalid query"
|
|
619
|
-
* },
|
|
620
|
-
* {
|
|
621
|
-
* "errors": [
|
|
622
|
-
* "The operator '=' is not supported by the 'summary' field."
|
|
623
|
-
* ],
|
|
624
|
-
* "query": "summary = test"
|
|
625
|
-
* },
|
|
626
|
-
* {
|
|
627
|
-
* "errors": [
|
|
628
|
-
* "Operator 'in' does not support the non-list value '\"test\"' for field
|
|
629
|
-
* 'summary'."
|
|
630
|
-
* ],
|
|
631
|
-
* "query": "summary in test"
|
|
632
|
-
* },
|
|
633
|
-
* {
|
|
634
|
-
* "errors": [
|
|
635
|
-
* "The value 'INVALID' does not exist for the field 'project'."
|
|
636
|
-
* ],
|
|
637
|
-
* "query": "project = INVALID"
|
|
638
|
-
* },
|
|
639
|
-
* {
|
|
640
|
-
* "errors": [
|
|
641
|
-
* "Field 'universe' does not exist or you do not have permission to view
|
|
642
|
-
* it."
|
|
643
|
-
* ],
|
|
644
|
-
* "query": "universe = 42"
|
|
645
|
-
* }
|
|
646
|
-
* ]
|
|
647
|
-
* }
|
|
648
|
-
* @path {POST} /rest/api/3/jql/parse
|
|
649
|
-
* @scopes-current read:jira-work
|
|
650
|
-
* @scopes-beta read:field:jira, validate:jql:jira, read:jql:jira
|
|
651
|
-
*/
|
|
652
|
-
parseJqlQueries({
|
|
653
|
-
validation,
|
|
654
|
-
jqlQueriesToParse,
|
|
655
|
-
}: {
|
|
656
|
-
/**
|
|
657
|
-
* How to validate the JQL query and treat the validation results. Validation
|
|
658
|
-
* options include:
|
|
659
|
-
*
|
|
660
|
-
* * `strict` Returns all errors. If validation fails, the query structure is
|
|
661
|
-
* not returned.
|
|
662
|
-
* * `warn` Returns all errors. If validation fails but the JQL query is
|
|
663
|
-
* correctly formed, the query structure is returned.
|
|
664
|
-
* * `none` No validation is performed. If JQL query is correctly formed, the
|
|
665
|
-
* query structure is returned.
|
|
666
|
-
*/
|
|
667
|
-
validation: "strict" | "warn" | "none";
|
|
668
|
-
/**
|
|
669
|
-
* @example {
|
|
670
|
-
* "queries": [
|
|
671
|
-
* "summary ~ test AND (labels in (urgent, blocker) OR lastCommentedBy =
|
|
672
|
-
* currentUser()) AND status CHANGED AFTER startOfMonth(-1M) ORDER BY updated
|
|
673
|
-
* DESC",
|
|
674
|
-
* "issue.property[\"spaces here\"].value in (\"Service requests\",
|
|
675
|
-
* Incidents)",
|
|
676
|
-
* "invalid query",
|
|
677
|
-
* "summary = test",
|
|
678
|
-
* "summary in test",
|
|
679
|
-
* "project = INVALID",
|
|
680
|
-
* "universe = 42"
|
|
681
|
-
* ]
|
|
682
|
-
* }
|
|
683
|
-
*/
|
|
684
|
-
jqlQueriesToParse: JqlQueriesToParse;
|
|
685
|
-
}): Promise<ParsedJqlQueries> {
|
|
686
|
-
return this.getClientInstance()
|
|
687
|
-
.request({
|
|
688
|
-
path: "/rest/api/3/jql/parse",
|
|
689
|
-
method: "POST",
|
|
690
|
-
query: {
|
|
691
|
-
validation,
|
|
692
|
-
},
|
|
693
|
-
headers: {
|
|
694
|
-
"Content-Type": "application/json",
|
|
695
|
-
},
|
|
696
|
-
body: jqlQueriesToParse,
|
|
697
|
-
})
|
|
698
|
-
.then(
|
|
699
|
-
this.getClientInstance().responseHandler({
|
|
700
|
-
200: {
|
|
701
|
-
"application/json": "json",
|
|
702
|
-
},
|
|
703
|
-
}),
|
|
704
|
-
)
|
|
705
|
-
.then(
|
|
706
|
-
commonHttpClient.castResponse<{
|
|
707
|
-
status: 200;
|
|
708
|
-
mediaType: "application/json";
|
|
709
|
-
body: ParsedJqlQueries;
|
|
710
|
-
}>(),
|
|
711
|
-
)
|
|
712
|
-
.then(
|
|
713
|
-
validationSchemaStorage.validator(
|
|
714
|
-
"JqlService.parseJqlQueries.response",
|
|
715
|
-
),
|
|
716
|
-
)
|
|
717
|
-
.then(commonHttpClient.getBody);
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Sanitizes one or more JQL queries by converting readable details into IDs where
|
|
721
|
-
* a user doesn't have permission to view the entity.
|
|
722
|
-
*
|
|
723
|
-
* For example, if the query contains the clause *project = 'Secret project'*, and
|
|
724
|
-
* a user does not have browse permission for the project "Secret project", the
|
|
725
|
-
* sanitized query replaces the clause with *project = 12345"* (where 12345 is the
|
|
726
|
-
* ID of the project). If a user has the required permission, the clause is not
|
|
727
|
-
* sanitized. If the account ID is null, sanitizing is performed for an anonymous
|
|
728
|
-
* user.
|
|
729
|
-
*
|
|
730
|
-
* Note that sanitization doesn't make the queries GDPR-compliant, because it
|
|
731
|
-
* doesn't remove user identifiers (username or user key). If you need to make
|
|
732
|
-
* queries GDPR-compliant, use [Convert user identifiers to account IDs in JQL
|
|
733
|
-
* queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post).
|
|
734
|
-
*
|
|
735
|
-
* Before sanitization each JQL query is parsed. The queries are returned in the
|
|
736
|
-
* same order that they were passed.
|
|
737
|
-
*
|
|
738
|
-
* **[Permissions](#permissions) required:** *Administer Jira* [global
|
|
739
|
-
* permission](https://confluence.atlassian.com/x/x4dKLg).
|
|
740
|
-
*
|
|
741
|
-
* @returns Returned if the request is successful.
|
|
742
|
-
*
|
|
743
|
-
* example: {
|
|
744
|
-
* "queries": [
|
|
745
|
-
* {
|
|
746
|
-
* "initialQuery": "project = 'Sample project'",
|
|
747
|
-
* "sanitizedQuery": "project = 12345"
|
|
748
|
-
* },
|
|
749
|
-
* {
|
|
750
|
-
* "initialQuery": "project = 'Sample project'",
|
|
751
|
-
* "sanitizedQuery": "project = 'Sample project'",
|
|
752
|
-
* "accountId": "5b10ac8d82e05b22cc7d4ef5"
|
|
753
|
-
* },
|
|
754
|
-
* {
|
|
755
|
-
* "initialQuery": "project = 'Sample project'",
|
|
756
|
-
* "sanitizedQuery": "project = 12345",
|
|
757
|
-
* "accountId": "cda2aa1395ac195d951b3387"
|
|
758
|
-
* },
|
|
759
|
-
* {
|
|
760
|
-
* "initialQuery": "non-parsable query",
|
|
761
|
-
* "errors": {
|
|
762
|
-
* "errorMessages": [
|
|
763
|
-
* "Error in the JQL Query: Expecting operator but got 'query'. The
|
|
764
|
-
* valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN',
|
|
765
|
-
* 'IS' and 'IS NOT'. (line 1, character 9)"
|
|
766
|
-
* ],
|
|
767
|
-
* "errors": {}
|
|
768
|
-
* },
|
|
769
|
-
* "accountId": "5b10ac8d82e05b22cc7d4ef5"
|
|
770
|
-
* }
|
|
771
|
-
* ]
|
|
772
|
-
* }
|
|
773
|
-
* @path {POST} /rest/api/3/jql/sanitize
|
|
774
|
-
* @scopes-current manage:jira-configuration
|
|
775
|
-
* @scopes-beta read:jql:jira
|
|
776
|
-
*/
|
|
777
|
-
sanitiseJqlQueries({
|
|
778
|
-
jqlQueriesToSanitize,
|
|
779
|
-
}: {
|
|
780
|
-
/**
|
|
781
|
-
* @example {
|
|
782
|
-
* "queries": [
|
|
783
|
-
* {
|
|
784
|
-
* "query": "project = 'Sample project'"
|
|
785
|
-
* },
|
|
786
|
-
* {
|
|
787
|
-
* "accountId": "5b10ac8d82e05b22cc7d4ef5",
|
|
788
|
-
* "query": "project = 'Sample project'"
|
|
789
|
-
* },
|
|
790
|
-
* {
|
|
791
|
-
* "accountId": "cda2aa1395ac195d951b3387",
|
|
792
|
-
* "query": "project = 'Sample project'"
|
|
793
|
-
* },
|
|
794
|
-
* {
|
|
795
|
-
* "accountId": "5b10ac8d82e05b22cc7d4ef5",
|
|
796
|
-
* "query": "invalid query"
|
|
797
|
-
* }
|
|
798
|
-
* ]
|
|
799
|
-
* }
|
|
800
|
-
*/
|
|
801
|
-
jqlQueriesToSanitize: JqlQueriesToSanitize;
|
|
802
|
-
}): Promise<SanitizedJqlQueries> {
|
|
803
|
-
return this.getClientInstance()
|
|
804
|
-
.request({
|
|
805
|
-
path: "/rest/api/3/jql/sanitize",
|
|
806
|
-
method: "POST",
|
|
807
|
-
headers: {
|
|
808
|
-
"Content-Type": "application/json",
|
|
809
|
-
},
|
|
810
|
-
body: jqlQueriesToSanitize,
|
|
811
|
-
})
|
|
812
|
-
.then(
|
|
813
|
-
this.getClientInstance().responseHandler({
|
|
814
|
-
200: {
|
|
815
|
-
"application/json": "json",
|
|
816
|
-
},
|
|
817
|
-
}),
|
|
818
|
-
)
|
|
819
|
-
.then(
|
|
820
|
-
commonHttpClient.castResponse<{
|
|
821
|
-
status: 200;
|
|
822
|
-
mediaType: "application/json";
|
|
823
|
-
body: SanitizedJqlQueries;
|
|
824
|
-
}>(),
|
|
825
|
-
)
|
|
826
|
-
.then(
|
|
827
|
-
validationSchemaStorage.validator(
|
|
828
|
-
"JqlService.sanitiseJqlQueries.response",
|
|
829
|
-
),
|
|
830
|
-
)
|
|
831
|
-
.then(commonHttpClient.getBody);
|
|
832
|
-
}
|
|
833
|
-
static initialize() {
|
|
834
|
-
validationSchemaStorage.registerExtensible(
|
|
835
|
-
"JqlService.getAutoComplete.response",
|
|
836
|
-
z
|
|
837
|
-
.object({
|
|
838
|
-
status: z.literal(200),
|
|
839
|
-
mediaType: z.literal("application/json"),
|
|
840
|
-
body: validationSchemaStorage.lazy("JqlReferenceData"),
|
|
841
|
-
})
|
|
842
|
-
.describe("JqlService.getAutoComplete.response"),
|
|
843
|
-
);
|
|
844
|
-
validationSchemaStorage.registerExtensible(
|
|
845
|
-
"JqlService.getAutoCompletePost.response",
|
|
846
|
-
z
|
|
847
|
-
.object({
|
|
848
|
-
status: z.literal(200),
|
|
849
|
-
mediaType: z.literal("application/json"),
|
|
850
|
-
body: validationSchemaStorage.lazy("JqlReferenceData"),
|
|
851
|
-
})
|
|
852
|
-
.describe("JqlService.getAutoCompletePost.response"),
|
|
853
|
-
);
|
|
854
|
-
validationSchemaStorage.registerExtensible(
|
|
855
|
-
"JqlService.getFieldAutoCompleteForQueryString.response",
|
|
856
|
-
z
|
|
857
|
-
.object({
|
|
858
|
-
status: z.literal(200),
|
|
859
|
-
mediaType: z.literal("application/json"),
|
|
860
|
-
body: validationSchemaStorage.lazy("AutoCompleteSuggestions"),
|
|
861
|
-
})
|
|
862
|
-
.describe("JqlService.getFieldAutoCompleteForQueryString.response"),
|
|
863
|
-
);
|
|
864
|
-
validationSchemaStorage.registerExtensible(
|
|
865
|
-
"JqlService.parseJqlQueries.response",
|
|
866
|
-
z
|
|
867
|
-
.object({
|
|
868
|
-
status: z.literal(200),
|
|
869
|
-
mediaType: z.literal("application/json"),
|
|
870
|
-
body: validationSchemaStorage.lazy("ParsedJqlQueries"),
|
|
871
|
-
})
|
|
872
|
-
.describe("JqlService.parseJqlQueries.response"),
|
|
873
|
-
);
|
|
874
|
-
validationSchemaStorage.registerExtensible(
|
|
875
|
-
"JqlService.migrateQueries.response",
|
|
876
|
-
z
|
|
877
|
-
.object({
|
|
878
|
-
status: z.literal(200),
|
|
879
|
-
mediaType: z.literal("application/json"),
|
|
880
|
-
body: validationSchemaStorage.lazy("ConvertedJqlQueries"),
|
|
881
|
-
})
|
|
882
|
-
.describe("JqlService.migrateQueries.response"),
|
|
883
|
-
);
|
|
884
|
-
validationSchemaStorage.registerExtensible(
|
|
885
|
-
"JqlService.sanitiseJqlQueries.response",
|
|
886
|
-
z
|
|
887
|
-
.object({
|
|
888
|
-
status: z.literal(200),
|
|
889
|
-
mediaType: z.literal("application/json"),
|
|
890
|
-
body: validationSchemaStorage.lazy("SanitizedJqlQueries"),
|
|
891
|
-
})
|
|
892
|
-
.describe("JqlService.sanitiseJqlQueries.response"),
|
|
893
|
-
);
|
|
894
|
-
validationSchemaStorage.registerOnce([registerJqlValidationSchemas]);
|
|
895
|
-
}
|
|
896
|
-
}
|