@resolution/jira-api-client 0.4.6 → 0.5.0
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 +11 -0
- package/README.md +27 -4
- package/lib/index.d.ts +13 -0
- package/lib/index.js +17 -1
- package/lib/index.js.map +1 -1
- package/lib/openapi/platform/BaseJiraPlatformApiClient.d.ts +1 -1
- package/lib/openapi/platform/BaseJiraPlatformApiClient.js +1 -1
- package/lib/openapi/platform/services/DashboardsService.d.ts +7 -1
- package/lib/openapi/platform/services/DashboardsService.js +4 -1
- package/lib/openapi/platform/services/DashboardsService.js.map +1 -1
- package/lib/openapi/platform/services/IssueSearchService.d.ts +8 -1
- package/lib/openapi/platform/services/IssueSearchService.js +2 -1
- package/lib/openapi/platform/services/IssueSearchService.js.map +1 -1
- package/lib/openapi/platform/services/IssuesService.d.ts +8 -1
- package/lib/openapi/platform/services/IssuesService.js +2 -1
- package/lib/openapi/platform/services/IssuesService.js.map +1 -1
- package/lib/openapi/platform/services/PermissionsService.d.ts +7 -0
- package/lib/openapi/platform/services/PermissionsService.js +7 -0
- package/lib/openapi/platform/services/PermissionsService.js.map +1 -1
- package/lib/openapi/serviceManagement/BaseJiraServiceManagementApiClient.d.ts +46 -0
- package/lib/openapi/serviceManagement/BaseJiraServiceManagementApiClient.js +78 -0
- package/lib/openapi/serviceManagement/BaseJiraServiceManagementApiClient.js.map +1 -0
- package/lib/openapi/serviceManagement/core/CommonHttpClient.d.ts +196 -0
- package/lib/openapi/serviceManagement/core/CommonHttpClient.js +390 -0
- package/lib/openapi/serviceManagement/core/CommonHttpClient.js.map +1 -0
- package/lib/openapi/serviceManagement/core/CommonHttpService.d.ts +9 -0
- package/lib/openapi/serviceManagement/core/CommonHttpService.js +29 -0
- package/lib/openapi/serviceManagement/core/CommonHttpService.js.map +1 -0
- package/lib/openapi/serviceManagement/core/CommonValidationSchemaStorage.d.ts +35 -0
- package/lib/openapi/serviceManagement/core/CommonValidationSchemaStorage.js +65 -0
- package/lib/openapi/serviceManagement/core/CommonValidationSchemaStorage.js.map +1 -0
- package/lib/openapi/serviceManagement/models/assets.d.ts +54 -0
- package/lib/openapi/serviceManagement/models/assets.js +60 -0
- package/lib/openapi/serviceManagement/models/assets.js.map +1 -0
- package/lib/openapi/serviceManagement/models/common.d.ts +228 -0
- package/lib/openapi/serviceManagement/models/common.js +172 -0
- package/lib/openapi/serviceManagement/models/common.js.map +1 -0
- package/lib/openapi/serviceManagement/models/customer.d.ts +30 -0
- package/lib/openapi/serviceManagement/models/customer.js +27 -0
- package/lib/openapi/serviceManagement/models/customer.js.map +1 -0
- package/lib/openapi/serviceManagement/models/info.d.ts +18 -0
- package/lib/openapi/serviceManagement/models/info.js +24 -0
- package/lib/openapi/serviceManagement/models/info.js.map +1 -0
- package/lib/openapi/serviceManagement/models/knowledgebase.d.ts +24 -0
- package/lib/openapi/serviceManagement/models/knowledgebase.js +32 -0
- package/lib/openapi/serviceManagement/models/knowledgebase.js.map +1 -0
- package/lib/openapi/serviceManagement/models/organization.d.ts +76 -0
- package/lib/openapi/serviceManagement/models/organization.js +65 -0
- package/lib/openapi/serviceManagement/models/organization.js.map +1 -0
- package/lib/openapi/serviceManagement/models/request.d.ts +594 -0
- package/lib/openapi/serviceManagement/models/request.js +516 -0
- package/lib/openapi/serviceManagement/models/request.js.map +1 -0
- package/lib/openapi/serviceManagement/models/servicedesk.d.ts +525 -0
- package/lib/openapi/serviceManagement/models/servicedesk.js +442 -0
- package/lib/openapi/serviceManagement/models/servicedesk.js.map +1 -0
- package/lib/openapi/serviceManagement/services/AssetsService.d.ts +61 -0
- package/lib/openapi/serviceManagement/services/AssetsService.js +113 -0
- package/lib/openapi/serviceManagement/services/AssetsService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/CustomerService.d.ts +63 -0
- package/lib/openapi/serviceManagement/services/CustomerService.js +93 -0
- package/lib/openapi/serviceManagement/services/CustomerService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/InfoService.d.ts +34 -0
- package/lib/openapi/serviceManagement/services/InfoService.js +71 -0
- package/lib/openapi/serviceManagement/services/InfoService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/KnowledgebaseService.d.ts +81 -0
- package/lib/openapi/serviceManagement/services/KnowledgebaseService.js +106 -0
- package/lib/openapi/serviceManagement/services/KnowledgebaseService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/OrganizationService.d.ts +589 -0
- package/lib/openapi/serviceManagement/services/OrganizationService.js +762 -0
- package/lib/openapi/serviceManagement/services/OrganizationService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/RequestService.d.ts +2736 -0
- package/lib/openapi/serviceManagement/services/RequestService.js +3056 -0
- package/lib/openapi/serviceManagement/services/RequestService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/RequesttypeService.d.ts +166 -0
- package/lib/openapi/serviceManagement/services/RequesttypeService.js +190 -0
- package/lib/openapi/serviceManagement/services/RequesttypeService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/ServicedeskService.d.ts +1268 -0
- package/lib/openapi/serviceManagement/services/ServicedeskService.js +1510 -0
- package/lib/openapi/serviceManagement/services/ServicedeskService.js.map +1 -0
- package/lib/openapi/serviceManagement/validationSchemaStorage.d.ts +3 -0
- package/lib/openapi/serviceManagement/validationSchemaStorage.js +144 -0
- package/lib/openapi/serviceManagement/validationSchemaStorage.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,3056 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestService = void 0;
|
|
4
|
+
// DO NOT EDIT!
|
|
5
|
+
// This file is generated by "api-typescript-generator".
|
|
6
|
+
// To update this file run "yarn build:openapi".
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const commonHttpClient = require("../core/CommonHttpClient");
|
|
9
|
+
const CommonHttpService_1 = require("../core/CommonHttpService");
|
|
10
|
+
const common_1 = require("../models/common");
|
|
11
|
+
const request_1 = require("../models/request");
|
|
12
|
+
const validationSchemaStorage_1 = require("../validationSchemaStorage");
|
|
13
|
+
/** @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request */
|
|
14
|
+
class RequestService extends CommonHttpService_1.CommonHttpService {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
/**
|
|
18
|
+
* This method adds participants to a customer request.
|
|
19
|
+
*
|
|
20
|
+
* **[Permissions](#permissions) required**: Permission to manage participants on
|
|
21
|
+
* the customer request.
|
|
22
|
+
*
|
|
23
|
+
* Note, participants can be added when creating a customer request using the
|
|
24
|
+
* [request](#api-request-post) resource, by defining the participants in the
|
|
25
|
+
* `requestParticipants` field.
|
|
26
|
+
*
|
|
27
|
+
* @returns Returns the participants added to the customer request.
|
|
28
|
+
*
|
|
29
|
+
* example: {
|
|
30
|
+
* "_expands": [],
|
|
31
|
+
* "size": 1,
|
|
32
|
+
* "start": 1,
|
|
33
|
+
* "limit": 1,
|
|
34
|
+
* "isLastPage": false,
|
|
35
|
+
* "_links": {
|
|
36
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
37
|
+
* "context": "context",
|
|
38
|
+
* "next":
|
|
39
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1000/participant?start=2&limit=1",
|
|
40
|
+
* "prev":
|
|
41
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1000/participant?start=0&limit=1"
|
|
42
|
+
* },
|
|
43
|
+
* "values": [
|
|
44
|
+
* {
|
|
45
|
+
* "accountId":
|
|
46
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
47
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
48
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
49
|
+
* "emailAddress": "fred@example.com",
|
|
50
|
+
* "displayName": "Fred F. User",
|
|
51
|
+
* "active": true,
|
|
52
|
+
* "timeZone": "Australia/Sydney",
|
|
53
|
+
* "_links": {
|
|
54
|
+
* "jiraRest":
|
|
55
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
56
|
+
* "avatarUrls": {
|
|
57
|
+
* "16x16":
|
|
58
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
59
|
+
* "24x24":
|
|
60
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
61
|
+
* "32x32":
|
|
62
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
63
|
+
* "48x48":
|
|
64
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
65
|
+
* },
|
|
66
|
+
* "self":
|
|
67
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
* ]
|
|
71
|
+
* }
|
|
72
|
+
* @path {POST} /rest/servicedeskapi/request/{issueIdOrKey}/participant
|
|
73
|
+
* @scopes-current write:servicedesk-request
|
|
74
|
+
* @scopes-beta read:request.participant:jira-service-management,
|
|
75
|
+
* write:request.participant:jira-service-management, read:user:jira
|
|
76
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-participant-post
|
|
77
|
+
*/
|
|
78
|
+
this.addRequestParticipants = ({ issueIdOrKey, requestParticipantUpdateDto, }) => {
|
|
79
|
+
return this.getClientInstance()
|
|
80
|
+
.request({
|
|
81
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/participant",
|
|
82
|
+
method: "POST",
|
|
83
|
+
pathParams: {
|
|
84
|
+
issueIdOrKey,
|
|
85
|
+
},
|
|
86
|
+
headers: {
|
|
87
|
+
"Content-Type": "application/json",
|
|
88
|
+
},
|
|
89
|
+
body: requestParticipantUpdateDto,
|
|
90
|
+
})
|
|
91
|
+
.then(this.getClientInstance().responseHandler({
|
|
92
|
+
200: {
|
|
93
|
+
"application/json": "json",
|
|
94
|
+
},
|
|
95
|
+
}))
|
|
96
|
+
.then(commonHttpClient.castResponse())
|
|
97
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.addRequestParticipants.response"))
|
|
98
|
+
.then(commonHttpClient.getBody);
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* This method enables a user to **Approve** or **Decline** an approval on a
|
|
102
|
+
* customer request. The approval is assumed to be owned by the user making the
|
|
103
|
+
* call.
|
|
104
|
+
*
|
|
105
|
+
* **[Permissions](#permissions) required**: User is assigned to the approval
|
|
106
|
+
* request.
|
|
107
|
+
*
|
|
108
|
+
* @returns Returns the updated approval.
|
|
109
|
+
*
|
|
110
|
+
* example: {
|
|
111
|
+
* "id": "1",
|
|
112
|
+
* "name": "Please approve this request",
|
|
113
|
+
* "finalDecision": "approved",
|
|
114
|
+
* "canAnswerApproval": false,
|
|
115
|
+
* "approvers": [
|
|
116
|
+
* {
|
|
117
|
+
* "approver": {
|
|
118
|
+
* "accountId":
|
|
119
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
120
|
+
* "name":
|
|
121
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
122
|
+
* "key":
|
|
123
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
124
|
+
* "emailAddress": "fred@example.com",
|
|
125
|
+
* "displayName": "Fred F. User",
|
|
126
|
+
* "active": true,
|
|
127
|
+
* "timeZone": "Australia/Sydney",
|
|
128
|
+
* "_links": {
|
|
129
|
+
* "jiraRest":
|
|
130
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
131
|
+
* "avatarUrls": {
|
|
132
|
+
* "16x16":
|
|
133
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
134
|
+
* "24x24":
|
|
135
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
136
|
+
* "32x32":
|
|
137
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
138
|
+
* "48x48":
|
|
139
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
140
|
+
* },
|
|
141
|
+
* "self":
|
|
142
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
143
|
+
* }
|
|
144
|
+
* },
|
|
145
|
+
* "approverDecision": "approved"
|
|
146
|
+
* }
|
|
147
|
+
* ],
|
|
148
|
+
* "createdDate": {
|
|
149
|
+
* "epochMillis": 1475046060000,
|
|
150
|
+
* "friendly": "Monday 14:01 PM",
|
|
151
|
+
* "iso8601": "2016-09-28T14:01:00+0700",
|
|
152
|
+
* "jira": "2016-09-28T14:01:00.000+0700"
|
|
153
|
+
* },
|
|
154
|
+
* "completedDate": {
|
|
155
|
+
* "epochMillis": 1475134200000,
|
|
156
|
+
* "friendly": "Today 14:30 PM",
|
|
157
|
+
* "iso8601": "2016-09-29T14:30:00+0700",
|
|
158
|
+
* "jira": "2016-09-29T14:30:00.000+0700"
|
|
159
|
+
* },
|
|
160
|
+
* "_links": {
|
|
161
|
+
* "self":
|
|
162
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2/approval/1"
|
|
163
|
+
* }
|
|
164
|
+
* }
|
|
165
|
+
* @path {POST} /rest/servicedeskapi/request/{issueIdOrKey}/approval/{approvalId}
|
|
166
|
+
* @scopes-current write:servicedesk-request
|
|
167
|
+
* @scopes-beta read:request.approval:jira-service-management,
|
|
168
|
+
* write:request.approval:jira-service-management, read:user:jira
|
|
169
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-approval-approvalid-post
|
|
170
|
+
*/
|
|
171
|
+
this.answerApproval = ({ issueIdOrKey, approvalId, approvalDecisionRequestDto, }) => {
|
|
172
|
+
return this.getClientInstance()
|
|
173
|
+
.request({
|
|
174
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/approval/{approvalId}",
|
|
175
|
+
method: "POST",
|
|
176
|
+
pathParams: {
|
|
177
|
+
issueIdOrKey,
|
|
178
|
+
approvalId,
|
|
179
|
+
},
|
|
180
|
+
headers: {
|
|
181
|
+
"Content-Type": "application/json",
|
|
182
|
+
},
|
|
183
|
+
body: approvalDecisionRequestDto,
|
|
184
|
+
})
|
|
185
|
+
.then(this.getClientInstance().responseHandler({
|
|
186
|
+
200: {
|
|
187
|
+
"application/json": "json",
|
|
188
|
+
},
|
|
189
|
+
}))
|
|
190
|
+
.then(commonHttpClient.castResponse())
|
|
191
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.answerApproval.response"))
|
|
192
|
+
.then(commonHttpClient.getBody);
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* This method creates a comment on a customer request using one or more
|
|
196
|
+
* attachment files (uploaded using
|
|
197
|
+
* [servicedeskapi/servicedesk/\{serviceDeskId\}/attachTemporaryFile](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-servicedesk/#api-rest-servicedeskapi-servicedesk-servicedeskid-attachtemporaryfile-post)),
|
|
198
|
+
* with the visibility set by `public`. See
|
|
199
|
+
*
|
|
200
|
+
* * GET
|
|
201
|
+
* [servicedeskapi/request/\{issueIdOrKey\}/attachment](./#api-rest-servicedeskapi-request-issueidorkey-attachment-get)
|
|
202
|
+
* * GET
|
|
203
|
+
* [servicedeskapi/request/\{issueIdOrKey\}/comment/\{commentId\}/attachment](./#api-rest-servicedeskapi-request-issueidorkey-comment-commentid-attachment-get)
|
|
204
|
+
*
|
|
205
|
+
* **[Permissions](#permissions) required**: Permission to add an attachment.
|
|
206
|
+
*
|
|
207
|
+
* **Request limitations**: Customers can set public visibility only.
|
|
208
|
+
*
|
|
209
|
+
* @returns Returns the attachments and comment.
|
|
210
|
+
*
|
|
211
|
+
* example: {
|
|
212
|
+
* "comment": {
|
|
213
|
+
* "_expands": [
|
|
214
|
+
* "attachment",
|
|
215
|
+
* "renderedBody"
|
|
216
|
+
* ],
|
|
217
|
+
* "id": "1000",
|
|
218
|
+
* "body": "Please find the screenshot and the log file attached.
|
|
219
|
+
* !screenshot.png|thumbnail! [^log.txt] _(32 kB)_",
|
|
220
|
+
* "public": true,
|
|
221
|
+
* "author": {
|
|
222
|
+
* "accountId":
|
|
223
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
224
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
225
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
226
|
+
* "emailAddress": "fred@example.com",
|
|
227
|
+
* "displayName": "Fred F. User",
|
|
228
|
+
* "active": true,
|
|
229
|
+
* "timeZone": "Australia/Sydney",
|
|
230
|
+
* "_links": {
|
|
231
|
+
* "jiraRest":
|
|
232
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
233
|
+
* "avatarUrls": {
|
|
234
|
+
* "16x16":
|
|
235
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
236
|
+
* "24x24":
|
|
237
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
238
|
+
* "32x32":
|
|
239
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
240
|
+
* "48x48":
|
|
241
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
242
|
+
* },
|
|
243
|
+
* "self":
|
|
244
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
245
|
+
* }
|
|
246
|
+
* },
|
|
247
|
+
* "created": {
|
|
248
|
+
* "epochMillis": 1444360920000,
|
|
249
|
+
* "friendly": "Today 10:22 AM",
|
|
250
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
251
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
252
|
+
* },
|
|
253
|
+
* "_links": {
|
|
254
|
+
* "self":
|
|
255
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2000/comment/1000"
|
|
256
|
+
* }
|
|
257
|
+
* },
|
|
258
|
+
* "attachments": {
|
|
259
|
+
* "_expands": [],
|
|
260
|
+
* "size": 2,
|
|
261
|
+
* "start": 2,
|
|
262
|
+
* "limit": 2,
|
|
263
|
+
* "isLastPage": false,
|
|
264
|
+
* "_links": {
|
|
265
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
266
|
+
* "context": "context",
|
|
267
|
+
* "next":
|
|
268
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/IT-15/comment/1001/attachment?start=4&limit=2",
|
|
269
|
+
* "prev":
|
|
270
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/IT-15/comment/1001/attachment?start=0&limit=2"
|
|
271
|
+
* },
|
|
272
|
+
* "values": [
|
|
273
|
+
* {
|
|
274
|
+
* "filename": "screenshot.png",
|
|
275
|
+
* "author": {
|
|
276
|
+
* "accountId":
|
|
277
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
278
|
+
* "name":
|
|
279
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
280
|
+
* "key":
|
|
281
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
282
|
+
* "emailAddress": "fred@example.com",
|
|
283
|
+
* "displayName": "Fred F. User",
|
|
284
|
+
* "active": true,
|
|
285
|
+
* "timeZone": "Australia/Sydney",
|
|
286
|
+
* "_links": {
|
|
287
|
+
* "jiraRest":
|
|
288
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
289
|
+
* "avatarUrls": {
|
|
290
|
+
* "16x16":
|
|
291
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
292
|
+
* "24x24":
|
|
293
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
294
|
+
* "32x32":
|
|
295
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
296
|
+
* "48x48":
|
|
297
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
298
|
+
* },
|
|
299
|
+
* "self":
|
|
300
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
301
|
+
* }
|
|
302
|
+
* },
|
|
303
|
+
* "created": {
|
|
304
|
+
* "epochMillis": 1444360920000,
|
|
305
|
+
* "friendly": "Today 10:22 AM",
|
|
306
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
307
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
308
|
+
* },
|
|
309
|
+
* "size": 23123,
|
|
310
|
+
* "mimeType": "image/png",
|
|
311
|
+
* "_links": {
|
|
312
|
+
* "jiraRest":
|
|
313
|
+
* "https://your-domain.atlassian.net/rest/api/2/attachment/10000",
|
|
314
|
+
* "content":
|
|
315
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/attachment/10000/screenshot.png",
|
|
316
|
+
* "thumbnail":
|
|
317
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/thumbnail/10000/_thumb_10000.png"
|
|
318
|
+
* }
|
|
319
|
+
* },
|
|
320
|
+
* {
|
|
321
|
+
* "filename": "log.txt",
|
|
322
|
+
* "author": {
|
|
323
|
+
* "accountId":
|
|
324
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
325
|
+
* "name":
|
|
326
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
327
|
+
* "key":
|
|
328
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
329
|
+
* "emailAddress": "fred@example.com",
|
|
330
|
+
* "displayName": "Fred F. User",
|
|
331
|
+
* "active": true,
|
|
332
|
+
* "timeZone": "Australia/Sydney",
|
|
333
|
+
* "_links": {
|
|
334
|
+
* "jiraRest":
|
|
335
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
336
|
+
* "avatarUrls": {
|
|
337
|
+
* "16x16":
|
|
338
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
339
|
+
* "24x24":
|
|
340
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
341
|
+
* "32x32":
|
|
342
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
343
|
+
* "48x48":
|
|
344
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
345
|
+
* },
|
|
346
|
+
* "self":
|
|
347
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
348
|
+
* }
|
|
349
|
+
* },
|
|
350
|
+
* "created": {
|
|
351
|
+
* "epochMillis": 1444360920000,
|
|
352
|
+
* "friendly": "Today 10:22 AM",
|
|
353
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
354
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
355
|
+
* },
|
|
356
|
+
* "size": 32132,
|
|
357
|
+
* "mimeType": "text/plain",
|
|
358
|
+
* "_links": {
|
|
359
|
+
* "jiraRest":
|
|
360
|
+
* "https://your-domain.atlassian.net/rest/api/2/attachment/10001",
|
|
361
|
+
* "content":
|
|
362
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/attachment/10001/log.txt"
|
|
363
|
+
* }
|
|
364
|
+
* }
|
|
365
|
+
* ]
|
|
366
|
+
* }
|
|
367
|
+
* }
|
|
368
|
+
* @path {POST} /rest/servicedeskapi/request/{issueIdOrKey}/attachment
|
|
369
|
+
* @scopes-current write:servicedesk-request
|
|
370
|
+
* @scopes-beta read:request.attachment:jira-service-management,
|
|
371
|
+
* write:request.attachment:jira-service-management, read:user:jira
|
|
372
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-attachment-post
|
|
373
|
+
*/
|
|
374
|
+
this.createCommentWithAttachment = ({ issueIdOrKey, attachmentCreateDto, }) => {
|
|
375
|
+
return this.getClientInstance()
|
|
376
|
+
.request({
|
|
377
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/attachment",
|
|
378
|
+
method: "POST",
|
|
379
|
+
pathParams: {
|
|
380
|
+
issueIdOrKey,
|
|
381
|
+
},
|
|
382
|
+
headers: {
|
|
383
|
+
"Content-Type": "application/json",
|
|
384
|
+
},
|
|
385
|
+
body: attachmentCreateDto,
|
|
386
|
+
})
|
|
387
|
+
.then(this.getClientInstance().responseHandler({
|
|
388
|
+
201: {
|
|
389
|
+
"application/json": "json",
|
|
390
|
+
},
|
|
391
|
+
}))
|
|
392
|
+
.then(commonHttpClient.castResponse())
|
|
393
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.createCommentWithAttachment.response"))
|
|
394
|
+
.then(commonHttpClient.getBody);
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* This method creates a customer request in a service desk.
|
|
398
|
+
*
|
|
399
|
+
* The JSON request must include the service desk and customer request type, as
|
|
400
|
+
* well as any fields that are required for the request type. A list of the fields
|
|
401
|
+
* required by a customer request type can be obtained using
|
|
402
|
+
* [servicedesk/\{serviceDeskId\}/requesttype/\{requestTypeId\}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get).
|
|
403
|
+
*
|
|
404
|
+
* The fields required for a customer request type depend on the user's
|
|
405
|
+
* permissions:
|
|
406
|
+
*
|
|
407
|
+
* * `raiseOnBehalfOf` is not available to Users who have the customer
|
|
408
|
+
* permission only.
|
|
409
|
+
* * `requestParticipants` is not available to Users who have the customer
|
|
410
|
+
* permission only or if the feature is turned off for customers.
|
|
411
|
+
*
|
|
412
|
+
* `requestFieldValues` is a map of Jira field IDs and their values. See [Field
|
|
413
|
+
* input formats](#fieldformats), for details of each field's JSON semantics and
|
|
414
|
+
* the values they can take.
|
|
415
|
+
*
|
|
416
|
+
* **[Permissions](#permissions) required**: Permission to create requests in the
|
|
417
|
+
* specified service desk.
|
|
418
|
+
*
|
|
419
|
+
* @returns Returned if the customer request was created.
|
|
420
|
+
*
|
|
421
|
+
* example: {
|
|
422
|
+
* "_expands": [
|
|
423
|
+
* "participant",
|
|
424
|
+
* "status",
|
|
425
|
+
* "sla",
|
|
426
|
+
* "requestType",
|
|
427
|
+
* "serviceDesk",
|
|
428
|
+
* "attachment",
|
|
429
|
+
* "action",
|
|
430
|
+
* "comment"
|
|
431
|
+
* ],
|
|
432
|
+
* "issueId": "107001",
|
|
433
|
+
* "issueKey": "HELPDESK-1",
|
|
434
|
+
* "requestTypeId": "25",
|
|
435
|
+
* "serviceDeskId": "10",
|
|
436
|
+
* "createdDate": {
|
|
437
|
+
* "epochMillis": 1444290120000,
|
|
438
|
+
* "friendly": "Monday 14:42 PM",
|
|
439
|
+
* "iso8601": "2015-10-08T14:42:00+0700",
|
|
440
|
+
* "jira": "2015-10-08T14:42:00.000+0700"
|
|
441
|
+
* },
|
|
442
|
+
* "reporter": {
|
|
443
|
+
* "accountId":
|
|
444
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
445
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
446
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
447
|
+
* "emailAddress": "fred@example.com",
|
|
448
|
+
* "displayName": "Fred F. User",
|
|
449
|
+
* "active": true,
|
|
450
|
+
* "timeZone": "Australia/Sydney",
|
|
451
|
+
* "_links": {
|
|
452
|
+
* "jiraRest":
|
|
453
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
454
|
+
* "avatarUrls": {
|
|
455
|
+
* "16x16":
|
|
456
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
457
|
+
* "24x24":
|
|
458
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
459
|
+
* "32x32":
|
|
460
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
461
|
+
* "48x48":
|
|
462
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
463
|
+
* },
|
|
464
|
+
* "self":
|
|
465
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
466
|
+
* }
|
|
467
|
+
* },
|
|
468
|
+
* "requestFieldValues": [
|
|
469
|
+
* {
|
|
470
|
+
* "fieldId": "summary",
|
|
471
|
+
* "label": "What do you need?",
|
|
472
|
+
* "value": "Request JSD help via REST"
|
|
473
|
+
* },
|
|
474
|
+
* {
|
|
475
|
+
* "fieldId": "description",
|
|
476
|
+
* "label": "Why do you need this?",
|
|
477
|
+
* "renderedValue": {
|
|
478
|
+
* "html": "<p>I need a new <b>mouse</b> for my Mac</p>"
|
|
479
|
+
* },
|
|
480
|
+
* "value": "I need a new *mouse* for my Mac"
|
|
481
|
+
* }
|
|
482
|
+
* ],
|
|
483
|
+
* "currentStatus": {
|
|
484
|
+
* "status": "Waiting for Support",
|
|
485
|
+
* "statusCategory": "NEW",
|
|
486
|
+
* "statusDate": {
|
|
487
|
+
* "epochMillis": 1444287660000,
|
|
488
|
+
* "friendly": "Today 14:01 PM",
|
|
489
|
+
* "iso8601": "2015-10-08T14:01:00+0700",
|
|
490
|
+
* "jira": "2015-10-08T14:01:00.000+0700"
|
|
491
|
+
* }
|
|
492
|
+
* },
|
|
493
|
+
* "_links": {
|
|
494
|
+
* "jiraRest": "https://your-domain.atlassian.net/rest/api/2/issue/107001",
|
|
495
|
+
* "web":
|
|
496
|
+
* "https://your-domain.atlassian.net/servicedesk/customer/portal/10/HELPDESK-1",
|
|
497
|
+
* "self":
|
|
498
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/107001",
|
|
499
|
+
* "agent": "https://your-domain.atlassian.net/browse/HELPDESK-1"
|
|
500
|
+
* }
|
|
501
|
+
* }
|
|
502
|
+
* @path {POST} /rest/servicedeskapi/request
|
|
503
|
+
* @scopes-current write:servicedesk-request
|
|
504
|
+
* @scopes-beta read:request:jira-service-management, write:request:jira-service-management,
|
|
505
|
+
* read:user:jira
|
|
506
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-post
|
|
507
|
+
*/
|
|
508
|
+
this.createCustomerRequest = ({ requestCreateDto, }) => {
|
|
509
|
+
return this.getClientInstance()
|
|
510
|
+
.request({
|
|
511
|
+
path: "/rest/servicedeskapi/request",
|
|
512
|
+
method: "POST",
|
|
513
|
+
headers: {
|
|
514
|
+
"Content-Type": "application/json",
|
|
515
|
+
},
|
|
516
|
+
body: requestCreateDto,
|
|
517
|
+
})
|
|
518
|
+
.then(this.getClientInstance().responseHandler({
|
|
519
|
+
201: {
|
|
520
|
+
"application/json": "json",
|
|
521
|
+
},
|
|
522
|
+
}))
|
|
523
|
+
.then(commonHttpClient.castResponse())
|
|
524
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.createCustomerRequest.response"))
|
|
525
|
+
.then(commonHttpClient.getBody);
|
|
526
|
+
};
|
|
527
|
+
/**
|
|
528
|
+
* This method creates a public or private (internal) comment on a customer
|
|
529
|
+
* request, with the comment visibility set by `public`. The user recorded as the
|
|
530
|
+
* author of the comment.
|
|
531
|
+
*
|
|
532
|
+
* **[Permissions](#permissions) required**: User has Add Comments permission.
|
|
533
|
+
*
|
|
534
|
+
* **Request limitations**: Customers can set comments to public visibility only.
|
|
535
|
+
*
|
|
536
|
+
* @returns Returns the comment.
|
|
537
|
+
*
|
|
538
|
+
* example: {
|
|
539
|
+
* "_expands": [
|
|
540
|
+
* "attachment",
|
|
541
|
+
* "renderedBody"
|
|
542
|
+
* ],
|
|
543
|
+
* "id": "1000",
|
|
544
|
+
* "body": "Hello there",
|
|
545
|
+
* "public": true,
|
|
546
|
+
* "author": {
|
|
547
|
+
* "accountId":
|
|
548
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
549
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
550
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
551
|
+
* "emailAddress": "fred@example.com",
|
|
552
|
+
* "displayName": "Fred F. User",
|
|
553
|
+
* "active": true,
|
|
554
|
+
* "timeZone": "Australia/Sydney",
|
|
555
|
+
* "_links": {
|
|
556
|
+
* "jiraRest":
|
|
557
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
558
|
+
* "avatarUrls": {
|
|
559
|
+
* "16x16":
|
|
560
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
561
|
+
* "24x24":
|
|
562
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
563
|
+
* "32x32":
|
|
564
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
565
|
+
* "48x48":
|
|
566
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
567
|
+
* },
|
|
568
|
+
* "self":
|
|
569
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
570
|
+
* }
|
|
571
|
+
* },
|
|
572
|
+
* "created": {
|
|
573
|
+
* "epochMillis": 1444360920000,
|
|
574
|
+
* "friendly": "Today 10:22 AM",
|
|
575
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
576
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
577
|
+
* },
|
|
578
|
+
* "_links": {
|
|
579
|
+
* "self":
|
|
580
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2000/comment/1000"
|
|
581
|
+
* }
|
|
582
|
+
* }
|
|
583
|
+
* @path {POST} /rest/servicedeskapi/request/{issueIdOrKey}/comment
|
|
584
|
+
* @scopes-current write:servicedesk-request
|
|
585
|
+
* @scopes-beta read:request.comment:jira-service-management,
|
|
586
|
+
* write:request.comment:jira-service-management, read:user:jira
|
|
587
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-comment-post
|
|
588
|
+
*/
|
|
589
|
+
this.createRequestComment = ({ issueIdOrKey, commentCreateDto, }) => {
|
|
590
|
+
return this.getClientInstance()
|
|
591
|
+
.request({
|
|
592
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/comment",
|
|
593
|
+
method: "POST",
|
|
594
|
+
pathParams: {
|
|
595
|
+
issueIdOrKey,
|
|
596
|
+
},
|
|
597
|
+
headers: {
|
|
598
|
+
"Content-Type": "application/json",
|
|
599
|
+
},
|
|
600
|
+
body: commentCreateDto,
|
|
601
|
+
})
|
|
602
|
+
.then(this.getClientInstance().responseHandler({
|
|
603
|
+
201: {
|
|
604
|
+
"application/json": "json",
|
|
605
|
+
},
|
|
606
|
+
}))
|
|
607
|
+
.then(commonHttpClient.castResponse())
|
|
608
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.createRequestComment.response"))
|
|
609
|
+
.then(commonHttpClient.getBody);
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* This method deletes the feedback of request using it's `requestKey` or
|
|
613
|
+
* `requestId`
|
|
614
|
+
*
|
|
615
|
+
* **[Permissions](#permissions) required**: User must be the reporter or an
|
|
616
|
+
* Atlassian Connect app.
|
|
617
|
+
*
|
|
618
|
+
* @returns No content.
|
|
619
|
+
* @path {DELETE} /rest/servicedeskapi/request/{requestIdOrKey}/feedback
|
|
620
|
+
* @scopes-current write:servicedesk-request
|
|
621
|
+
* @scopes-beta read:request.feedback:jira-service-management,
|
|
622
|
+
* delete:request.feedback:jira-service-management, read:user:jira
|
|
623
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-requestidorkey-feedback-delete
|
|
624
|
+
*/
|
|
625
|
+
this.deleteFeedback = ({ requestIdOrKey, }) => {
|
|
626
|
+
return this.getClientInstance()
|
|
627
|
+
.request({
|
|
628
|
+
path: "/rest/servicedeskapi/request/{requestIdOrKey}/feedback",
|
|
629
|
+
method: "DELETE",
|
|
630
|
+
pathParams: {
|
|
631
|
+
requestIdOrKey,
|
|
632
|
+
},
|
|
633
|
+
})
|
|
634
|
+
.then(this.getClientInstance().responseHandler({
|
|
635
|
+
204: {
|
|
636
|
+
"application/json": "json",
|
|
637
|
+
},
|
|
638
|
+
}))
|
|
639
|
+
.then(commonHttpClient.castResponse())
|
|
640
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.deleteFeedback.response"))
|
|
641
|
+
.then(commonHttpClient.getBody);
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* This method returns an approval. Use this method to determine the status of an
|
|
645
|
+
* approval and the list of approvers.
|
|
646
|
+
*
|
|
647
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
648
|
+
* request.
|
|
649
|
+
*
|
|
650
|
+
* @returns Returns the requested approval.
|
|
651
|
+
*
|
|
652
|
+
* example: {
|
|
653
|
+
* "id": "1",
|
|
654
|
+
* "name": "Please approve this request",
|
|
655
|
+
* "finalDecision": "approved",
|
|
656
|
+
* "canAnswerApproval": false,
|
|
657
|
+
* "approvers": [
|
|
658
|
+
* {
|
|
659
|
+
* "approver": {
|
|
660
|
+
* "accountId":
|
|
661
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
662
|
+
* "name":
|
|
663
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
664
|
+
* "key":
|
|
665
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
666
|
+
* "emailAddress": "fred@example.com",
|
|
667
|
+
* "displayName": "Fred F. User",
|
|
668
|
+
* "active": true,
|
|
669
|
+
* "timeZone": "Australia/Sydney",
|
|
670
|
+
* "_links": {
|
|
671
|
+
* "jiraRest":
|
|
672
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
673
|
+
* "avatarUrls": {
|
|
674
|
+
* "16x16":
|
|
675
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
676
|
+
* "24x24":
|
|
677
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
678
|
+
* "32x32":
|
|
679
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
680
|
+
* "48x48":
|
|
681
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
682
|
+
* },
|
|
683
|
+
* "self":
|
|
684
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
685
|
+
* }
|
|
686
|
+
* },
|
|
687
|
+
* "approverDecision": "approved"
|
|
688
|
+
* }
|
|
689
|
+
* ],
|
|
690
|
+
* "createdDate": {
|
|
691
|
+
* "epochMillis": 1475046060000,
|
|
692
|
+
* "friendly": "Monday 14:01 PM",
|
|
693
|
+
* "iso8601": "2016-09-28T14:01:00+0700",
|
|
694
|
+
* "jira": "2016-09-28T14:01:00.000+0700"
|
|
695
|
+
* },
|
|
696
|
+
* "completedDate": {
|
|
697
|
+
* "epochMillis": 1475134200000,
|
|
698
|
+
* "friendly": "Today 14:30 PM",
|
|
699
|
+
* "iso8601": "2016-09-29T14:30:00+0700",
|
|
700
|
+
* "jira": "2016-09-29T14:30:00.000+0700"
|
|
701
|
+
* },
|
|
702
|
+
* "_links": {
|
|
703
|
+
* "self":
|
|
704
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2/approval/1"
|
|
705
|
+
* }
|
|
706
|
+
* }
|
|
707
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/approval/{approvalId}
|
|
708
|
+
* @scopes-current read:servicedesk-request
|
|
709
|
+
* @scopes-beta read:request.approval:jira-service-management, read:user:jira
|
|
710
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-approval-approvalid-get
|
|
711
|
+
*/
|
|
712
|
+
this.getApprovalById = ({ issueIdOrKey, approvalId, }) => {
|
|
713
|
+
return this.getClientInstance()
|
|
714
|
+
.request({
|
|
715
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/approval/{approvalId}",
|
|
716
|
+
method: "GET",
|
|
717
|
+
pathParams: {
|
|
718
|
+
issueIdOrKey,
|
|
719
|
+
approvalId,
|
|
720
|
+
},
|
|
721
|
+
})
|
|
722
|
+
.then(this.getClientInstance().responseHandler({
|
|
723
|
+
200: {
|
|
724
|
+
"application/json": "json",
|
|
725
|
+
},
|
|
726
|
+
}))
|
|
727
|
+
.then(commonHttpClient.castResponse())
|
|
728
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getApprovalById.response"))
|
|
729
|
+
.then(commonHttpClient.getBody);
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* This method returns all approvals on a customer request.
|
|
733
|
+
*
|
|
734
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
735
|
+
* request.
|
|
736
|
+
*
|
|
737
|
+
* @returns Returns the customer request's approvals.
|
|
738
|
+
*
|
|
739
|
+
* example: {
|
|
740
|
+
* "_expands": [],
|
|
741
|
+
* "size": 3,
|
|
742
|
+
* "start": 3,
|
|
743
|
+
* "limit": 3,
|
|
744
|
+
* "isLastPage": false,
|
|
745
|
+
* "_links": {
|
|
746
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
747
|
+
* "context": "context",
|
|
748
|
+
* "next":
|
|
749
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2/approval?start=6&limit=3",
|
|
750
|
+
* "prev":
|
|
751
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2/approval?start=0&limit=3"
|
|
752
|
+
* },
|
|
753
|
+
* "values": [
|
|
754
|
+
* {
|
|
755
|
+
* "id": "1",
|
|
756
|
+
* "name": "Please approve this request",
|
|
757
|
+
* "finalDecision": "approved",
|
|
758
|
+
* "canAnswerApproval": false,
|
|
759
|
+
* "approvers": [
|
|
760
|
+
* {
|
|
761
|
+
* "approver": {
|
|
762
|
+
* "accountId":
|
|
763
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
764
|
+
* "name":
|
|
765
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
766
|
+
* "key":
|
|
767
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
768
|
+
* "emailAddress": "fred@example.com",
|
|
769
|
+
* "displayName": "Fred F. User",
|
|
770
|
+
* "active": true,
|
|
771
|
+
* "timeZone": "Australia/Sydney",
|
|
772
|
+
* "_links": {
|
|
773
|
+
* "jiraRest":
|
|
774
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
775
|
+
* "avatarUrls": {
|
|
776
|
+
* "16x16":
|
|
777
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
778
|
+
* "24x24":
|
|
779
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
780
|
+
* "32x32":
|
|
781
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
782
|
+
* "48x48":
|
|
783
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
784
|
+
* },
|
|
785
|
+
* "self":
|
|
786
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
787
|
+
* }
|
|
788
|
+
* },
|
|
789
|
+
* "approverDecision": "approved"
|
|
790
|
+
* }
|
|
791
|
+
* ],
|
|
792
|
+
* "createdDate": {
|
|
793
|
+
* "epochMillis": 1475046060000,
|
|
794
|
+
* "friendly": "Monday 14:01 PM",
|
|
795
|
+
* "iso8601": "2016-09-28T14:01:00+0700",
|
|
796
|
+
* "jira": "2016-09-28T14:01:00.000+0700"
|
|
797
|
+
* },
|
|
798
|
+
* "completedDate": {
|
|
799
|
+
* "epochMillis": 1475134200000,
|
|
800
|
+
* "friendly": "Today 14:30 PM",
|
|
801
|
+
* "iso8601": "2016-09-29T14:30:00+0700",
|
|
802
|
+
* "jira": "2016-09-29T14:30:00.000+0700"
|
|
803
|
+
* },
|
|
804
|
+
* "_links": {
|
|
805
|
+
* "self":
|
|
806
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2/approval/1"
|
|
807
|
+
* }
|
|
808
|
+
* },
|
|
809
|
+
* {
|
|
810
|
+
* "id": "2",
|
|
811
|
+
* "name": "Waiting for approval",
|
|
812
|
+
* "finalDecision": "declined",
|
|
813
|
+
* "canAnswerApproval": false,
|
|
814
|
+
* "approvers": [
|
|
815
|
+
* {
|
|
816
|
+
* "approver": {
|
|
817
|
+
* "accountId":
|
|
818
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
819
|
+
* "name":
|
|
820
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
821
|
+
* "key":
|
|
822
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
823
|
+
* "emailAddress": "fred@example.com",
|
|
824
|
+
* "displayName": "Fred F. User",
|
|
825
|
+
* "active": true,
|
|
826
|
+
* "timeZone": "Australia/Sydney",
|
|
827
|
+
* "_links": {
|
|
828
|
+
* "jiraRest":
|
|
829
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
830
|
+
* "avatarUrls": {
|
|
831
|
+
* "16x16":
|
|
832
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
833
|
+
* "24x24":
|
|
834
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
835
|
+
* "32x32":
|
|
836
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
837
|
+
* "48x48":
|
|
838
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
839
|
+
* },
|
|
840
|
+
* "self":
|
|
841
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
842
|
+
* }
|
|
843
|
+
* },
|
|
844
|
+
* "approverDecision": "approved"
|
|
845
|
+
* }
|
|
846
|
+
* ],
|
|
847
|
+
* "createdDate": {
|
|
848
|
+
* "epochMillis": 1475650860000,
|
|
849
|
+
* "friendly": "Wednesday 14:01 PM",
|
|
850
|
+
* "iso8601": "2016-10-05T14:01:00+0700",
|
|
851
|
+
* "jira": "2016-10-05T14:01:00.000+0700"
|
|
852
|
+
* },
|
|
853
|
+
* "completedDate": {
|
|
854
|
+
* "epochMillis": 1475739000000,
|
|
855
|
+
* "friendly": "Thursday 14:30 PM",
|
|
856
|
+
* "iso8601": "2016-10-06T14:30:00+0700",
|
|
857
|
+
* "jira": "2016-10-06T14:30:00.000+0700"
|
|
858
|
+
* },
|
|
859
|
+
* "_links": {
|
|
860
|
+
* "self":
|
|
861
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2/approval/2"
|
|
862
|
+
* }
|
|
863
|
+
* }
|
|
864
|
+
* ]
|
|
865
|
+
* }
|
|
866
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/approval
|
|
867
|
+
* @scopes-current read:servicedesk-request
|
|
868
|
+
* @scopes-beta read:request.approval:jira-service-management, read:user:jira
|
|
869
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-approval-get
|
|
870
|
+
*/
|
|
871
|
+
this.getApprovals = ({ issueIdOrKey, start, limit, }) => {
|
|
872
|
+
return this.getClientInstance()
|
|
873
|
+
.request({
|
|
874
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/approval",
|
|
875
|
+
method: "GET",
|
|
876
|
+
pathParams: {
|
|
877
|
+
issueIdOrKey,
|
|
878
|
+
},
|
|
879
|
+
query: {
|
|
880
|
+
start,
|
|
881
|
+
limit,
|
|
882
|
+
},
|
|
883
|
+
})
|
|
884
|
+
.then(this.getClientInstance().responseHandler({
|
|
885
|
+
200: {
|
|
886
|
+
"application/json": "json",
|
|
887
|
+
},
|
|
888
|
+
}))
|
|
889
|
+
.then(commonHttpClient.castResponse())
|
|
890
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getApprovals.response"))
|
|
891
|
+
.then(commonHttpClient.getBody);
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* Returns the contents of an attachment.
|
|
895
|
+
*
|
|
896
|
+
* To return a thumbnail of the attachment, use
|
|
897
|
+
* [servicedeskapi/request/\{issueIdOrKey\}/attachment/\{attachmentId\}/thumbnail](./#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get).
|
|
898
|
+
*
|
|
899
|
+
* **[Permissions](#permissions) required:** For the issue containing the
|
|
900
|
+
* attachment:
|
|
901
|
+
*
|
|
902
|
+
* * *Browse projects* [project
|
|
903
|
+
* permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
|
|
904
|
+
* issue is in.
|
|
905
|
+
* * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
|
|
906
|
+
* configured, issue-level security permission to view the issue.
|
|
907
|
+
*
|
|
908
|
+
* @returns 200 response
|
|
909
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}
|
|
910
|
+
* @scopes-current read:servicedesk-request
|
|
911
|
+
* @scopes-beta read:request.attachment:jira-service-management, read:user:jira
|
|
912
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get
|
|
913
|
+
*/
|
|
914
|
+
this.getAttachmentContent = ({ issueIdOrKey, attachmentId, }) => {
|
|
915
|
+
return this.getClientInstance()
|
|
916
|
+
.request({
|
|
917
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}",
|
|
918
|
+
method: "GET",
|
|
919
|
+
pathParams: {
|
|
920
|
+
issueIdOrKey,
|
|
921
|
+
attachmentId,
|
|
922
|
+
},
|
|
923
|
+
})
|
|
924
|
+
.then(this.getClientInstance().responseHandler({
|
|
925
|
+
200: {
|
|
926
|
+
"application/json": "json",
|
|
927
|
+
},
|
|
928
|
+
}))
|
|
929
|
+
.then(commonHttpClient.castResponse())
|
|
930
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getAttachmentContent.response"))
|
|
931
|
+
.then(commonHttpClient.getBody);
|
|
932
|
+
};
|
|
933
|
+
/**
|
|
934
|
+
* This method returns all the attachments for a customer requests.
|
|
935
|
+
*
|
|
936
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
937
|
+
* request.
|
|
938
|
+
*
|
|
939
|
+
* **Response limitations**: Customers will only get a list of public attachments.
|
|
940
|
+
*
|
|
941
|
+
* @returns Returns the visible attachments from the customer request.
|
|
942
|
+
*
|
|
943
|
+
* example: {
|
|
944
|
+
* "_expands": [],
|
|
945
|
+
* "size": 2,
|
|
946
|
+
* "start": 2,
|
|
947
|
+
* "limit": 2,
|
|
948
|
+
* "isLastPage": false,
|
|
949
|
+
* "_links": {
|
|
950
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
951
|
+
* "context": "context",
|
|
952
|
+
* "next":
|
|
953
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/IT-15/comment/1001/attachment?start=4&limit=2",
|
|
954
|
+
* "prev":
|
|
955
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/IT-15/comment/1001/attachment?start=0&limit=2"
|
|
956
|
+
* },
|
|
957
|
+
* "values": [
|
|
958
|
+
* {
|
|
959
|
+
* "filename": "screenshot.png",
|
|
960
|
+
* "author": {
|
|
961
|
+
* "accountId":
|
|
962
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
963
|
+
* "name":
|
|
964
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
965
|
+
* "key":
|
|
966
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
967
|
+
* "emailAddress": "fred@example.com",
|
|
968
|
+
* "displayName": "Fred F. User",
|
|
969
|
+
* "active": true,
|
|
970
|
+
* "timeZone": "Australia/Sydney",
|
|
971
|
+
* "_links": {
|
|
972
|
+
* "jiraRest":
|
|
973
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
974
|
+
* "avatarUrls": {
|
|
975
|
+
* "16x16":
|
|
976
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
977
|
+
* "24x24":
|
|
978
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
979
|
+
* "32x32":
|
|
980
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
981
|
+
* "48x48":
|
|
982
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
983
|
+
* },
|
|
984
|
+
* "self":
|
|
985
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
986
|
+
* }
|
|
987
|
+
* },
|
|
988
|
+
* "created": {
|
|
989
|
+
* "epochMillis": 1444360920000,
|
|
990
|
+
* "friendly": "Today 10:22 AM",
|
|
991
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
992
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
993
|
+
* },
|
|
994
|
+
* "size": 23123,
|
|
995
|
+
* "mimeType": "image/png",
|
|
996
|
+
* "_links": {
|
|
997
|
+
* "jiraRest":
|
|
998
|
+
* "https://your-domain.atlassian.net/rest/api/2/attachment/10000",
|
|
999
|
+
* "content":
|
|
1000
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/attachment/10000/screenshot.png",
|
|
1001
|
+
* "thumbnail":
|
|
1002
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/thumbnail/10000/_thumb_10000.png"
|
|
1003
|
+
* }
|
|
1004
|
+
* },
|
|
1005
|
+
* {
|
|
1006
|
+
* "filename": "log.txt",
|
|
1007
|
+
* "author": {
|
|
1008
|
+
* "accountId":
|
|
1009
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1010
|
+
* "name":
|
|
1011
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1012
|
+
* "key":
|
|
1013
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1014
|
+
* "emailAddress": "fred@example.com",
|
|
1015
|
+
* "displayName": "Fred F. User",
|
|
1016
|
+
* "active": true,
|
|
1017
|
+
* "timeZone": "Australia/Sydney",
|
|
1018
|
+
* "_links": {
|
|
1019
|
+
* "jiraRest":
|
|
1020
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1021
|
+
* "avatarUrls": {
|
|
1022
|
+
* "16x16":
|
|
1023
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1024
|
+
* "24x24":
|
|
1025
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1026
|
+
* "32x32":
|
|
1027
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1028
|
+
* "48x48":
|
|
1029
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1030
|
+
* },
|
|
1031
|
+
* "self":
|
|
1032
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1033
|
+
* }
|
|
1034
|
+
* },
|
|
1035
|
+
* "created": {
|
|
1036
|
+
* "epochMillis": 1444360920000,
|
|
1037
|
+
* "friendly": "Today 10:22 AM",
|
|
1038
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
1039
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
1040
|
+
* },
|
|
1041
|
+
* "size": 32132,
|
|
1042
|
+
* "mimeType": "text/plain",
|
|
1043
|
+
* "_links": {
|
|
1044
|
+
* "jiraRest":
|
|
1045
|
+
* "https://your-domain.atlassian.net/rest/api/2/attachment/10001",
|
|
1046
|
+
* "content":
|
|
1047
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/attachment/10001/log.txt"
|
|
1048
|
+
* }
|
|
1049
|
+
* }
|
|
1050
|
+
* ]
|
|
1051
|
+
* }
|
|
1052
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/attachment
|
|
1053
|
+
* @scopes-current read:servicedesk-request
|
|
1054
|
+
* @scopes-beta read:request.attachment:jira-service-management, read:user:jira
|
|
1055
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-attachment-get
|
|
1056
|
+
*/
|
|
1057
|
+
this.getAttachmentsForRequest = ({ issueIdOrKey, start, limit, }) => {
|
|
1058
|
+
return this.getClientInstance()
|
|
1059
|
+
.request({
|
|
1060
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/attachment",
|
|
1061
|
+
method: "GET",
|
|
1062
|
+
pathParams: {
|
|
1063
|
+
issueIdOrKey,
|
|
1064
|
+
},
|
|
1065
|
+
query: {
|
|
1066
|
+
start,
|
|
1067
|
+
limit,
|
|
1068
|
+
},
|
|
1069
|
+
})
|
|
1070
|
+
.then(this.getClientInstance().responseHandler({
|
|
1071
|
+
200: {
|
|
1072
|
+
"application/json": "json",
|
|
1073
|
+
},
|
|
1074
|
+
}))
|
|
1075
|
+
.then(commonHttpClient.castResponse())
|
|
1076
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getAttachmentsForRequest.response"))
|
|
1077
|
+
.then(commonHttpClient.getBody);
|
|
1078
|
+
};
|
|
1079
|
+
/**
|
|
1080
|
+
* Returns the thumbnail of an attachment.
|
|
1081
|
+
*
|
|
1082
|
+
* To return the attachment contents, use
|
|
1083
|
+
* [servicedeskapi/request/\{issueIdOrKey\}/attachment/\{attachmentId\}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get).
|
|
1084
|
+
*
|
|
1085
|
+
* **[Permissions](#permissions) required:** For the issue containing the
|
|
1086
|
+
* attachment:
|
|
1087
|
+
*
|
|
1088
|
+
* * *Browse projects* [project
|
|
1089
|
+
* permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
|
|
1090
|
+
* issue is in.
|
|
1091
|
+
* * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
|
|
1092
|
+
* configured, issue-level security permission to view the issue.
|
|
1093
|
+
*
|
|
1094
|
+
* @returns 200 response
|
|
1095
|
+
* @path {GET}
|
|
1096
|
+
* /rest/servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail
|
|
1097
|
+
* @scopes-current read:servicedesk-request
|
|
1098
|
+
* @scopes-beta read:request.attachment:jira-service-management, read:user:jira
|
|
1099
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get
|
|
1100
|
+
*/
|
|
1101
|
+
this.getAttachmentThumbnail = ({ issueIdOrKey, attachmentId, }) => {
|
|
1102
|
+
return this.getClientInstance()
|
|
1103
|
+
.request({
|
|
1104
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail",
|
|
1105
|
+
method: "GET",
|
|
1106
|
+
pathParams: {
|
|
1107
|
+
issueIdOrKey,
|
|
1108
|
+
attachmentId,
|
|
1109
|
+
},
|
|
1110
|
+
})
|
|
1111
|
+
.then(this.getClientInstance().responseHandler({
|
|
1112
|
+
200: {
|
|
1113
|
+
"application/json": "json",
|
|
1114
|
+
},
|
|
1115
|
+
}))
|
|
1116
|
+
.then(commonHttpClient.castResponse())
|
|
1117
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getAttachmentThumbnail.response"))
|
|
1118
|
+
.then(commonHttpClient.getBody);
|
|
1119
|
+
};
|
|
1120
|
+
/**
|
|
1121
|
+
* This method returns the attachments referenced in a comment.
|
|
1122
|
+
*
|
|
1123
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
1124
|
+
* request.
|
|
1125
|
+
*
|
|
1126
|
+
* **Response limitations**: Customers can only view public comments, and retrieve
|
|
1127
|
+
* their attachments, on requests where they are the reporter or a participant
|
|
1128
|
+
* whereas agents can see both internal and public comments.
|
|
1129
|
+
*
|
|
1130
|
+
* @returns Returns the attachments, on the specified page of the results.
|
|
1131
|
+
*
|
|
1132
|
+
* example: {
|
|
1133
|
+
* "_expands": [],
|
|
1134
|
+
* "size": 2,
|
|
1135
|
+
* "start": 2,
|
|
1136
|
+
* "limit": 2,
|
|
1137
|
+
* "isLastPage": false,
|
|
1138
|
+
* "_links": {
|
|
1139
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
1140
|
+
* "context": "context",
|
|
1141
|
+
* "next":
|
|
1142
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/IT-15/comment/1001/attachment?start=4&limit=2",
|
|
1143
|
+
* "prev":
|
|
1144
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/IT-15/comment/1001/attachment?start=0&limit=2"
|
|
1145
|
+
* },
|
|
1146
|
+
* "values": [
|
|
1147
|
+
* {
|
|
1148
|
+
* "filename": "screenshot.png",
|
|
1149
|
+
* "author": {
|
|
1150
|
+
* "accountId":
|
|
1151
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1152
|
+
* "name":
|
|
1153
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1154
|
+
* "key":
|
|
1155
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1156
|
+
* "emailAddress": "fred@example.com",
|
|
1157
|
+
* "displayName": "Fred F. User",
|
|
1158
|
+
* "active": true,
|
|
1159
|
+
* "timeZone": "Australia/Sydney",
|
|
1160
|
+
* "_links": {
|
|
1161
|
+
* "jiraRest":
|
|
1162
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1163
|
+
* "avatarUrls": {
|
|
1164
|
+
* "16x16":
|
|
1165
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1166
|
+
* "24x24":
|
|
1167
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1168
|
+
* "32x32":
|
|
1169
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1170
|
+
* "48x48":
|
|
1171
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1172
|
+
* },
|
|
1173
|
+
* "self":
|
|
1174
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1175
|
+
* }
|
|
1176
|
+
* },
|
|
1177
|
+
* "created": {
|
|
1178
|
+
* "epochMillis": 1444360920000,
|
|
1179
|
+
* "friendly": "Today 10:22 AM",
|
|
1180
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
1181
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
1182
|
+
* },
|
|
1183
|
+
* "size": 23123,
|
|
1184
|
+
* "mimeType": "image/png",
|
|
1185
|
+
* "_links": {
|
|
1186
|
+
* "jiraRest":
|
|
1187
|
+
* "https://your-domain.atlassian.net/rest/api/2/attachment/10000",
|
|
1188
|
+
* "content":
|
|
1189
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/attachment/10000/screenshot.png",
|
|
1190
|
+
* "thumbnail":
|
|
1191
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/thumbnail/10000/_thumb_10000.png"
|
|
1192
|
+
* }
|
|
1193
|
+
* },
|
|
1194
|
+
* {
|
|
1195
|
+
* "filename": "log.txt",
|
|
1196
|
+
* "author": {
|
|
1197
|
+
* "accountId":
|
|
1198
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1199
|
+
* "name":
|
|
1200
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1201
|
+
* "key":
|
|
1202
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1203
|
+
* "emailAddress": "fred@example.com",
|
|
1204
|
+
* "displayName": "Fred F. User",
|
|
1205
|
+
* "active": true,
|
|
1206
|
+
* "timeZone": "Australia/Sydney",
|
|
1207
|
+
* "_links": {
|
|
1208
|
+
* "jiraRest":
|
|
1209
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1210
|
+
* "avatarUrls": {
|
|
1211
|
+
* "16x16":
|
|
1212
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1213
|
+
* "24x24":
|
|
1214
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1215
|
+
* "32x32":
|
|
1216
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1217
|
+
* "48x48":
|
|
1218
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1219
|
+
* },
|
|
1220
|
+
* "self":
|
|
1221
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1222
|
+
* }
|
|
1223
|
+
* },
|
|
1224
|
+
* "created": {
|
|
1225
|
+
* "epochMillis": 1444360920000,
|
|
1226
|
+
* "friendly": "Today 10:22 AM",
|
|
1227
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
1228
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
1229
|
+
* },
|
|
1230
|
+
* "size": 32132,
|
|
1231
|
+
* "mimeType": "text/plain",
|
|
1232
|
+
* "_links": {
|
|
1233
|
+
* "jiraRest":
|
|
1234
|
+
* "https://your-domain.atlassian.net/rest/api/2/attachment/10001",
|
|
1235
|
+
* "content":
|
|
1236
|
+
* "https://your-domain.atlassian.net/servicedesk/customershim/secure/attachment/10001/log.txt"
|
|
1237
|
+
* }
|
|
1238
|
+
* }
|
|
1239
|
+
* ]
|
|
1240
|
+
* }
|
|
1241
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment
|
|
1242
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-comment-commentid-attachment-get
|
|
1243
|
+
*/
|
|
1244
|
+
this.getCommentAttachments = ({ issueIdOrKey, commentId, start, limit, }) => {
|
|
1245
|
+
return this.getClientInstance()
|
|
1246
|
+
.request({
|
|
1247
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment",
|
|
1248
|
+
method: "GET",
|
|
1249
|
+
pathParams: {
|
|
1250
|
+
issueIdOrKey,
|
|
1251
|
+
commentId,
|
|
1252
|
+
},
|
|
1253
|
+
query: {
|
|
1254
|
+
start,
|
|
1255
|
+
limit,
|
|
1256
|
+
},
|
|
1257
|
+
})
|
|
1258
|
+
.then(this.getClientInstance().responseHandler({
|
|
1259
|
+
200: {
|
|
1260
|
+
"application/json": "json",
|
|
1261
|
+
},
|
|
1262
|
+
}))
|
|
1263
|
+
.then(commonHttpClient.castResponse())
|
|
1264
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getCommentAttachments.response"))
|
|
1265
|
+
.then(commonHttpClient.getBody);
|
|
1266
|
+
};
|
|
1267
|
+
/**
|
|
1268
|
+
* This method returns a customer request.
|
|
1269
|
+
*
|
|
1270
|
+
* **[Permissions](#permissions) required**: Permission to access the specified
|
|
1271
|
+
* service desk.
|
|
1272
|
+
*
|
|
1273
|
+
* **Response limitations**: For customers, only a request they created, was
|
|
1274
|
+
* created on their behalf, or they are participating in will be returned.
|
|
1275
|
+
*
|
|
1276
|
+
* **Note:** `requestFieldValues` does not include hidden fields. To get a list of
|
|
1277
|
+
* request type fields that includes hidden fields, see
|
|
1278
|
+
* [/rest/servicedeskapi/servicedesk/\{serviceDeskId\}/requesttype/\{requestTypeId\}/field](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-servicedesk/#api-rest-servicedeskapi-servicedesk-servicedeskid-requesttype-requesttypeid-field-get)
|
|
1279
|
+
*
|
|
1280
|
+
* @returns Returns the customer request.
|
|
1281
|
+
*
|
|
1282
|
+
* example: {
|
|
1283
|
+
* "_expands": [
|
|
1284
|
+
* "participant",
|
|
1285
|
+
* "status",
|
|
1286
|
+
* "sla",
|
|
1287
|
+
* "requestType",
|
|
1288
|
+
* "serviceDesk",
|
|
1289
|
+
* "attachment",
|
|
1290
|
+
* "action",
|
|
1291
|
+
* "comment"
|
|
1292
|
+
* ],
|
|
1293
|
+
* "issueId": "107001",
|
|
1294
|
+
* "issueKey": "HELPDESK-1",
|
|
1295
|
+
* "requestTypeId": "25",
|
|
1296
|
+
* "serviceDeskId": "10",
|
|
1297
|
+
* "createdDate": {
|
|
1298
|
+
* "epochMillis": 1444290120000,
|
|
1299
|
+
* "friendly": "Monday 14:42 PM",
|
|
1300
|
+
* "iso8601": "2015-10-08T14:42:00+0700",
|
|
1301
|
+
* "jira": "2015-10-08T14:42:00.000+0700"
|
|
1302
|
+
* },
|
|
1303
|
+
* "reporter": {
|
|
1304
|
+
* "accountId":
|
|
1305
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1306
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1307
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1308
|
+
* "emailAddress": "fred@example.com",
|
|
1309
|
+
* "displayName": "Fred F. User",
|
|
1310
|
+
* "active": true,
|
|
1311
|
+
* "timeZone": "Australia/Sydney",
|
|
1312
|
+
* "_links": {
|
|
1313
|
+
* "jiraRest":
|
|
1314
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1315
|
+
* "avatarUrls": {
|
|
1316
|
+
* "16x16":
|
|
1317
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1318
|
+
* "24x24":
|
|
1319
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1320
|
+
* "32x32":
|
|
1321
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1322
|
+
* "48x48":
|
|
1323
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1324
|
+
* },
|
|
1325
|
+
* "self":
|
|
1326
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1327
|
+
* }
|
|
1328
|
+
* },
|
|
1329
|
+
* "requestFieldValues": [
|
|
1330
|
+
* {
|
|
1331
|
+
* "fieldId": "summary",
|
|
1332
|
+
* "label": "What do you need?",
|
|
1333
|
+
* "value": "Request JSD help via REST"
|
|
1334
|
+
* },
|
|
1335
|
+
* {
|
|
1336
|
+
* "fieldId": "description",
|
|
1337
|
+
* "label": "Why do you need this?",
|
|
1338
|
+
* "renderedValue": {
|
|
1339
|
+
* "html": "<p>I need a new <b>mouse</b> for my Mac</p>"
|
|
1340
|
+
* },
|
|
1341
|
+
* "value": "I need a new *mouse* for my Mac"
|
|
1342
|
+
* }
|
|
1343
|
+
* ],
|
|
1344
|
+
* "currentStatus": {
|
|
1345
|
+
* "status": "Waiting for Support",
|
|
1346
|
+
* "statusCategory": "NEW",
|
|
1347
|
+
* "statusDate": {
|
|
1348
|
+
* "epochMillis": 1444287660000,
|
|
1349
|
+
* "friendly": "Today 14:01 PM",
|
|
1350
|
+
* "iso8601": "2015-10-08T14:01:00+0700",
|
|
1351
|
+
* "jira": "2015-10-08T14:01:00.000+0700"
|
|
1352
|
+
* }
|
|
1353
|
+
* },
|
|
1354
|
+
* "_links": {
|
|
1355
|
+
* "jiraRest": "https://your-domain.atlassian.net/rest/api/2/issue/107001",
|
|
1356
|
+
* "web":
|
|
1357
|
+
* "https://your-domain.atlassian.net/servicedesk/customer/portal/10/HELPDESK-1",
|
|
1358
|
+
* "self":
|
|
1359
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/107001",
|
|
1360
|
+
* "agent": "https://your-domain.atlassian.net/browse/HELPDESK-1"
|
|
1361
|
+
* }
|
|
1362
|
+
* }
|
|
1363
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}
|
|
1364
|
+
* @scopes-current read:servicedesk-request
|
|
1365
|
+
* @scopes-beta read:request:jira-service-management, read:user:jira
|
|
1366
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-get
|
|
1367
|
+
*/
|
|
1368
|
+
this.getCustomerRequestByIdOrKey = ({ issueIdOrKey, expand, }) => {
|
|
1369
|
+
return this.getClientInstance()
|
|
1370
|
+
.request({
|
|
1371
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}",
|
|
1372
|
+
method: "GET",
|
|
1373
|
+
pathParams: {
|
|
1374
|
+
issueIdOrKey,
|
|
1375
|
+
},
|
|
1376
|
+
query: {
|
|
1377
|
+
expand,
|
|
1378
|
+
},
|
|
1379
|
+
})
|
|
1380
|
+
.then(this.getClientInstance().responseHandler({
|
|
1381
|
+
200: {
|
|
1382
|
+
"application/json": "json",
|
|
1383
|
+
},
|
|
1384
|
+
}))
|
|
1385
|
+
.then(commonHttpClient.castResponse())
|
|
1386
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getCustomerRequestByIdOrKey.response"))
|
|
1387
|
+
.then(commonHttpClient.getBody);
|
|
1388
|
+
};
|
|
1389
|
+
/**
|
|
1390
|
+
* This method returns all customer requests for the user executing the query.
|
|
1391
|
+
*
|
|
1392
|
+
* The returned customer requests are ordered chronologically by the latest
|
|
1393
|
+
* activity on each request. For example, the latest status transition or comment.
|
|
1394
|
+
*
|
|
1395
|
+
* **[Permissions](#permissions) required**: Permission to access the specified
|
|
1396
|
+
* service desk.
|
|
1397
|
+
*
|
|
1398
|
+
* **Response limitations**: For customers, the list returned will include request
|
|
1399
|
+
* they created (or were created on their behalf) or are participating in only.
|
|
1400
|
+
*
|
|
1401
|
+
* @returns Returns the customer requests, on the specified page of the results.
|
|
1402
|
+
*
|
|
1403
|
+
* example: {
|
|
1404
|
+
* "_expands": [
|
|
1405
|
+
* "participant",
|
|
1406
|
+
* "status",
|
|
1407
|
+
* "sla",
|
|
1408
|
+
* "requestType",
|
|
1409
|
+
* "serviceDesk",
|
|
1410
|
+
* "attachment",
|
|
1411
|
+
* "action",
|
|
1412
|
+
* "comment"
|
|
1413
|
+
* ],
|
|
1414
|
+
* "size": 3,
|
|
1415
|
+
* "start": 3,
|
|
1416
|
+
* "limit": 3,
|
|
1417
|
+
* "isLastPage": false,
|
|
1418
|
+
* "_links": {
|
|
1419
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
1420
|
+
* "context": "context",
|
|
1421
|
+
* "next":
|
|
1422
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request?start=6&limit=3",
|
|
1423
|
+
* "prev":
|
|
1424
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request?start=0&limit=3"
|
|
1425
|
+
* },
|
|
1426
|
+
* "values": [
|
|
1427
|
+
* {
|
|
1428
|
+
* "_expands": [
|
|
1429
|
+
* "participant",
|
|
1430
|
+
* "status",
|
|
1431
|
+
* "sla",
|
|
1432
|
+
* "requestType",
|
|
1433
|
+
* "serviceDesk",
|
|
1434
|
+
* "attachment",
|
|
1435
|
+
* "action",
|
|
1436
|
+
* "comment"
|
|
1437
|
+
* ],
|
|
1438
|
+
* "issueId": "107001",
|
|
1439
|
+
* "issueKey": "HELPDESK-1",
|
|
1440
|
+
* "requestTypeId": "25",
|
|
1441
|
+
* "serviceDeskId": "10",
|
|
1442
|
+
* "createdDate": {
|
|
1443
|
+
* "epochMillis": 1444290120000,
|
|
1444
|
+
* "friendly": "Monday 14:42 PM",
|
|
1445
|
+
* "iso8601": "2015-10-08T14:42:00+0700",
|
|
1446
|
+
* "jira": "2015-10-08T14:42:00.000+0700"
|
|
1447
|
+
* },
|
|
1448
|
+
* "reporter": {
|
|
1449
|
+
* "accountId":
|
|
1450
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1451
|
+
* "name":
|
|
1452
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1453
|
+
* "key":
|
|
1454
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1455
|
+
* "emailAddress": "fred@example.com",
|
|
1456
|
+
* "displayName": "Fred F. User",
|
|
1457
|
+
* "active": true,
|
|
1458
|
+
* "timeZone": "Australia/Sydney",
|
|
1459
|
+
* "_links": {
|
|
1460
|
+
* "jiraRest":
|
|
1461
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1462
|
+
* "avatarUrls": {
|
|
1463
|
+
* "16x16":
|
|
1464
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1465
|
+
* "24x24":
|
|
1466
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1467
|
+
* "32x32":
|
|
1468
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1469
|
+
* "48x48":
|
|
1470
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1471
|
+
* },
|
|
1472
|
+
* "self":
|
|
1473
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1474
|
+
* }
|
|
1475
|
+
* },
|
|
1476
|
+
* "requestFieldValues": [
|
|
1477
|
+
* {
|
|
1478
|
+
* "fieldId": "summary",
|
|
1479
|
+
* "label": "What do you need?",
|
|
1480
|
+
* "value": "Request JSD help via REST"
|
|
1481
|
+
* },
|
|
1482
|
+
* {
|
|
1483
|
+
* "fieldId": "description",
|
|
1484
|
+
* "label": "Why do you need this?",
|
|
1485
|
+
* "renderedValue": {
|
|
1486
|
+
* "html": "<p>I need a new <b>mouse</b> for my Mac</p>"
|
|
1487
|
+
* },
|
|
1488
|
+
* "value": "I need a new *mouse* for my Mac"
|
|
1489
|
+
* }
|
|
1490
|
+
* ],
|
|
1491
|
+
* "currentStatus": {
|
|
1492
|
+
* "status": "Waiting for Support",
|
|
1493
|
+
* "statusCategory": "NEW",
|
|
1494
|
+
* "statusDate": {
|
|
1495
|
+
* "epochMillis": 1444287660000,
|
|
1496
|
+
* "friendly": "Today 14:01 PM",
|
|
1497
|
+
* "iso8601": "2015-10-08T14:01:00+0700",
|
|
1498
|
+
* "jira": "2015-10-08T14:01:00.000+0700"
|
|
1499
|
+
* }
|
|
1500
|
+
* },
|
|
1501
|
+
* "_links": {
|
|
1502
|
+
* "jiraRest": "https://your-domain.atlassian.net/rest/api/2/issue/107001",
|
|
1503
|
+
* "web":
|
|
1504
|
+
* "https://your-domain.atlassian.net/servicedesk/customer/portal/10/HELPDESK-1",
|
|
1505
|
+
* "self":
|
|
1506
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/107001",
|
|
1507
|
+
* "agent": "https://your-domain.atlassian.net/browse/HELPDESK-1"
|
|
1508
|
+
* }
|
|
1509
|
+
* },
|
|
1510
|
+
* {
|
|
1511
|
+
* "_expands": [
|
|
1512
|
+
* "participant",
|
|
1513
|
+
* "status",
|
|
1514
|
+
* "sla",
|
|
1515
|
+
* "requestType",
|
|
1516
|
+
* "serviceDesk",
|
|
1517
|
+
* "attachment",
|
|
1518
|
+
* "action",
|
|
1519
|
+
* "comment"
|
|
1520
|
+
* ],
|
|
1521
|
+
* "issueId": "107002",
|
|
1522
|
+
* "issueKey": "HELPDESK-2",
|
|
1523
|
+
* "requestTypeId": "25",
|
|
1524
|
+
* "serviceDeskId": "10",
|
|
1525
|
+
* "createdDate": {
|
|
1526
|
+
* "epochMillis": 1444289400000,
|
|
1527
|
+
* "friendly": "Monday 14:30 PM",
|
|
1528
|
+
* "iso8601": "2015-10-08T14:30:00+0700",
|
|
1529
|
+
* "jira": "2015-10-08T14:30:00.000+0700"
|
|
1530
|
+
* },
|
|
1531
|
+
* "reporter": {
|
|
1532
|
+
* "accountId":
|
|
1533
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1534
|
+
* "name":
|
|
1535
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1536
|
+
* "key":
|
|
1537
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1538
|
+
* "emailAddress": "fred@example.com",
|
|
1539
|
+
* "displayName": "Fred F. User",
|
|
1540
|
+
* "active": true,
|
|
1541
|
+
* "timeZone": "Australia/Sydney",
|
|
1542
|
+
* "_links": {
|
|
1543
|
+
* "jiraRest":
|
|
1544
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1545
|
+
* "avatarUrls": {
|
|
1546
|
+
* "16x16":
|
|
1547
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1548
|
+
* "24x24":
|
|
1549
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1550
|
+
* "32x32":
|
|
1551
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1552
|
+
* "48x48":
|
|
1553
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1554
|
+
* },
|
|
1555
|
+
* "self":
|
|
1556
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1557
|
+
* }
|
|
1558
|
+
* },
|
|
1559
|
+
* "requestFieldValues": [
|
|
1560
|
+
* {
|
|
1561
|
+
* "fieldId": "summary",
|
|
1562
|
+
* "label": "What do you need?",
|
|
1563
|
+
* "value": "Request a new account"
|
|
1564
|
+
* },
|
|
1565
|
+
* {
|
|
1566
|
+
* "fieldId": "description",
|
|
1567
|
+
* "label": "Why do you need this?",
|
|
1568
|
+
* "value": "Create an account on Jira"
|
|
1569
|
+
* }
|
|
1570
|
+
* ],
|
|
1571
|
+
* "currentStatus": {
|
|
1572
|
+
* "status": "Waiting for Support",
|
|
1573
|
+
* "statusCategory": "NEW",
|
|
1574
|
+
* "statusDate": {
|
|
1575
|
+
* "epochMillis": 1444287660000,
|
|
1576
|
+
* "friendly": "Today 14:01 PM",
|
|
1577
|
+
* "iso8601": "2015-10-08T14:01:00+0700",
|
|
1578
|
+
* "jira": "2015-10-08T14:01:00.000+0700"
|
|
1579
|
+
* }
|
|
1580
|
+
* },
|
|
1581
|
+
* "_links": {
|
|
1582
|
+
* "jiraRest": "https://your-domain.atlassian.net/rest/api/2/issue/107002",
|
|
1583
|
+
* "web":
|
|
1584
|
+
* "https://your-domain.atlassian.net/servicedesk/customer/portal/10/HELPDESK-2",
|
|
1585
|
+
* "self":
|
|
1586
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/107002",
|
|
1587
|
+
* "agent": "https://your-domain.atlassian.net/browse/HELPDESK-2"
|
|
1588
|
+
* }
|
|
1589
|
+
* },
|
|
1590
|
+
* {
|
|
1591
|
+
* "_expands": [
|
|
1592
|
+
* "participant",
|
|
1593
|
+
* "status",
|
|
1594
|
+
* "sla",
|
|
1595
|
+
* "requestType",
|
|
1596
|
+
* "serviceDesk",
|
|
1597
|
+
* "attachment",
|
|
1598
|
+
* "action",
|
|
1599
|
+
* "comment"
|
|
1600
|
+
* ],
|
|
1601
|
+
* "issueId": "109006",
|
|
1602
|
+
* "issueKey": "SIMPLEDESK-6",
|
|
1603
|
+
* "requestTypeId": "33",
|
|
1604
|
+
* "serviceDeskId": "12",
|
|
1605
|
+
* "createdDate": {
|
|
1606
|
+
* "epochMillis": 1444030200000,
|
|
1607
|
+
* "friendly": "Monday 14:30 PM",
|
|
1608
|
+
* "iso8601": "2015-10-05T14:30:00+0700",
|
|
1609
|
+
* "jira": "2015-10-05T14:30:00.000+0700"
|
|
1610
|
+
* },
|
|
1611
|
+
* "reporter": {
|
|
1612
|
+
* "accountId":
|
|
1613
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1614
|
+
* "name":
|
|
1615
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1616
|
+
* "key":
|
|
1617
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1618
|
+
* "emailAddress": "fred@example.com",
|
|
1619
|
+
* "displayName": "Fred F. User",
|
|
1620
|
+
* "active": true,
|
|
1621
|
+
* "timeZone": "Australia/Sydney",
|
|
1622
|
+
* "_links": {
|
|
1623
|
+
* "jiraRest":
|
|
1624
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1625
|
+
* "avatarUrls": {
|
|
1626
|
+
* "16x16":
|
|
1627
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1628
|
+
* "24x24":
|
|
1629
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1630
|
+
* "32x32":
|
|
1631
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1632
|
+
* "48x48":
|
|
1633
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1634
|
+
* },
|
|
1635
|
+
* "self":
|
|
1636
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1637
|
+
* }
|
|
1638
|
+
* },
|
|
1639
|
+
* "requestFieldValues": [
|
|
1640
|
+
* {
|
|
1641
|
+
* "fieldId": "summary",
|
|
1642
|
+
* "label": "Summarize the problem",
|
|
1643
|
+
* "value": "Printer on level 3 did not work"
|
|
1644
|
+
* },
|
|
1645
|
+
* {
|
|
1646
|
+
* "fieldId": "description",
|
|
1647
|
+
* "value": "Ink cartridge is empty"
|
|
1648
|
+
* }
|
|
1649
|
+
* ],
|
|
1650
|
+
* "currentStatus": {
|
|
1651
|
+
* "status": "Waiting for Support",
|
|
1652
|
+
* "statusCategory": "NEW",
|
|
1653
|
+
* "statusDate": {
|
|
1654
|
+
* "epochMillis": 1444287600000,
|
|
1655
|
+
* "friendly": "Today 14:00 PM",
|
|
1656
|
+
* "iso8601": "2015-10-08T14:00:00+0700",
|
|
1657
|
+
* "jira": "2015-10-08T14:00:00.000+0700"
|
|
1658
|
+
* }
|
|
1659
|
+
* },
|
|
1660
|
+
* "_links": {
|
|
1661
|
+
* "jiraRest": "https://your-domain.atlassian.net/rest/api/2/issue/109006",
|
|
1662
|
+
* "web":
|
|
1663
|
+
* "https://your-domain.atlassian.net/servicedesk/customer/portal/12/SIMPLEDESK-6",
|
|
1664
|
+
* "self":
|
|
1665
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/109006",
|
|
1666
|
+
* "agent": "https://your-domain.atlassian.net/browse/SIMPLEDESK-6"
|
|
1667
|
+
* }
|
|
1668
|
+
* }
|
|
1669
|
+
* ]
|
|
1670
|
+
* }
|
|
1671
|
+
* @path {GET} /rest/servicedeskapi/request
|
|
1672
|
+
* @scopes-current read:servicedesk-request
|
|
1673
|
+
* @scopes-beta read:request:jira-service-management, read:user:jira
|
|
1674
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-get
|
|
1675
|
+
*/
|
|
1676
|
+
this.getCustomerRequests = ({ searchTerm, requestOwnership, requestStatus, approvalStatus, organizationId, serviceDeskId, requestTypeId, expand, start, limit, } = {}) => {
|
|
1677
|
+
return this.getClientInstance()
|
|
1678
|
+
.request({
|
|
1679
|
+
path: "/rest/servicedeskapi/request",
|
|
1680
|
+
method: "GET",
|
|
1681
|
+
query: {
|
|
1682
|
+
searchTerm,
|
|
1683
|
+
requestOwnership,
|
|
1684
|
+
requestStatus,
|
|
1685
|
+
approvalStatus,
|
|
1686
|
+
organizationId,
|
|
1687
|
+
serviceDeskId,
|
|
1688
|
+
requestTypeId,
|
|
1689
|
+
expand,
|
|
1690
|
+
start,
|
|
1691
|
+
limit,
|
|
1692
|
+
},
|
|
1693
|
+
})
|
|
1694
|
+
.then(this.getClientInstance().responseHandler({
|
|
1695
|
+
200: {
|
|
1696
|
+
"application/json": "json",
|
|
1697
|
+
},
|
|
1698
|
+
}))
|
|
1699
|
+
.then(commonHttpClient.castResponse())
|
|
1700
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getCustomerRequests.response"))
|
|
1701
|
+
.then(commonHttpClient.getBody);
|
|
1702
|
+
};
|
|
1703
|
+
/**
|
|
1704
|
+
* This method returns a list of all the statuses a customer Request has achieved.
|
|
1705
|
+
* A status represents the state of an issue in its workflow. An issue can have
|
|
1706
|
+
* one active status only. The list returns the status history in chronological
|
|
1707
|
+
* order, most recent (current) status first.
|
|
1708
|
+
*
|
|
1709
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
1710
|
+
* request.
|
|
1711
|
+
*
|
|
1712
|
+
* @returns Returns the customer request's status history, on the specified page of the
|
|
1713
|
+
* results.
|
|
1714
|
+
*
|
|
1715
|
+
* example: {
|
|
1716
|
+
* "_expands": [],
|
|
1717
|
+
* "size": 3,
|
|
1718
|
+
* "start": 3,
|
|
1719
|
+
* "limit": 3,
|
|
1720
|
+
* "isLastPage": false,
|
|
1721
|
+
* "_links": {
|
|
1722
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
1723
|
+
* "context": "context",
|
|
1724
|
+
* "next":
|
|
1725
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1/status?start=6&limit=3",
|
|
1726
|
+
* "prev":
|
|
1727
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1/status?start=0&limit=3"
|
|
1728
|
+
* },
|
|
1729
|
+
* "values": [
|
|
1730
|
+
* {
|
|
1731
|
+
* "status": "Waiting for Customer",
|
|
1732
|
+
* "statusDate": {
|
|
1733
|
+
* "epochMillis": 1444287900000,
|
|
1734
|
+
* "friendly": "Today 14:05 PM",
|
|
1735
|
+
* "iso8601": "2015-10-08T14:05:00+0700",
|
|
1736
|
+
* "jira": "2015-10-08T14:05:00.000+0700"
|
|
1737
|
+
* }
|
|
1738
|
+
* },
|
|
1739
|
+
* {
|
|
1740
|
+
* "status": "Waiting for Support",
|
|
1741
|
+
* "statusDate": {
|
|
1742
|
+
* "epochMillis": 1444287660000,
|
|
1743
|
+
* "friendly": "Today 14:01 PM",
|
|
1744
|
+
* "iso8601": "2015-10-08T14:01:00+0700",
|
|
1745
|
+
* "jira": "2015-10-08T14:01:00.000+0700"
|
|
1746
|
+
* }
|
|
1747
|
+
* },
|
|
1748
|
+
* {
|
|
1749
|
+
* "status": "Waiting for Customer",
|
|
1750
|
+
* "statusDate": {
|
|
1751
|
+
* "epochMillis": 1444287600000,
|
|
1752
|
+
* "friendly": "Today 14:00 PM",
|
|
1753
|
+
* "iso8601": "2015-10-08T14:00:00+0700",
|
|
1754
|
+
* "jira": "2015-10-08T14:00:00.000+0700"
|
|
1755
|
+
* }
|
|
1756
|
+
* }
|
|
1757
|
+
* ]
|
|
1758
|
+
* }
|
|
1759
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/status
|
|
1760
|
+
* @scopes-current read:servicedesk-request
|
|
1761
|
+
* @scopes-beta read:request.status:jira-service-management, read:user:jira
|
|
1762
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-status-get
|
|
1763
|
+
*/
|
|
1764
|
+
this.getCustomerRequestStatus = ({ issueIdOrKey, start, limit, }) => {
|
|
1765
|
+
return this.getClientInstance()
|
|
1766
|
+
.request({
|
|
1767
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/status",
|
|
1768
|
+
method: "GET",
|
|
1769
|
+
pathParams: {
|
|
1770
|
+
issueIdOrKey,
|
|
1771
|
+
},
|
|
1772
|
+
query: {
|
|
1773
|
+
start,
|
|
1774
|
+
limit,
|
|
1775
|
+
},
|
|
1776
|
+
})
|
|
1777
|
+
.then(this.getClientInstance().responseHandler({
|
|
1778
|
+
200: {
|
|
1779
|
+
"application/json": "json",
|
|
1780
|
+
},
|
|
1781
|
+
}))
|
|
1782
|
+
.then(commonHttpClient.castResponse())
|
|
1783
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getCustomerRequestStatus.response"))
|
|
1784
|
+
.then(commonHttpClient.getBody);
|
|
1785
|
+
};
|
|
1786
|
+
/**
|
|
1787
|
+
* This method returns a list of transitions, the workflow processes that moves a
|
|
1788
|
+
* customer request from one status to another, that the user can perform on a
|
|
1789
|
+
* request. Use this method to provide a user with a list if the actions they can
|
|
1790
|
+
* take on a customer request.
|
|
1791
|
+
*
|
|
1792
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
1793
|
+
* request.
|
|
1794
|
+
*
|
|
1795
|
+
* @returns Returns the transitions available to the user on the customer request.
|
|
1796
|
+
*
|
|
1797
|
+
* example: {
|
|
1798
|
+
* "_expands": [],
|
|
1799
|
+
* "size": 2,
|
|
1800
|
+
* "start": 2,
|
|
1801
|
+
* "limit": 2,
|
|
1802
|
+
* "isLastPage": false,
|
|
1803
|
+
* "_links": {
|
|
1804
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
1805
|
+
* "context": "context",
|
|
1806
|
+
* "next":
|
|
1807
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1/transition?start=4&limit=2",
|
|
1808
|
+
* "prev":
|
|
1809
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1/transition?start=0&limit=2"
|
|
1810
|
+
* },
|
|
1811
|
+
* "values": [
|
|
1812
|
+
* {
|
|
1813
|
+
* "id": "1",
|
|
1814
|
+
* "name": "Close Request"
|
|
1815
|
+
* },
|
|
1816
|
+
* {
|
|
1817
|
+
* "id": "2",
|
|
1818
|
+
* "name": "Escalate Request"
|
|
1819
|
+
* }
|
|
1820
|
+
* ]
|
|
1821
|
+
* }
|
|
1822
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/transition
|
|
1823
|
+
* @scopes-current read:servicedesk-request
|
|
1824
|
+
* @scopes-beta read:request.status:jira-service-management, read:user:jira
|
|
1825
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-transition-get
|
|
1826
|
+
*/
|
|
1827
|
+
this.getCustomerTransitions = ({ issueIdOrKey, start, limit, }) => {
|
|
1828
|
+
return this.getClientInstance()
|
|
1829
|
+
.request({
|
|
1830
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/transition",
|
|
1831
|
+
method: "GET",
|
|
1832
|
+
pathParams: {
|
|
1833
|
+
issueIdOrKey,
|
|
1834
|
+
},
|
|
1835
|
+
query: {
|
|
1836
|
+
start,
|
|
1837
|
+
limit,
|
|
1838
|
+
},
|
|
1839
|
+
})
|
|
1840
|
+
.then(this.getClientInstance().responseHandler({
|
|
1841
|
+
200: {
|
|
1842
|
+
"application/json": "json",
|
|
1843
|
+
},
|
|
1844
|
+
}))
|
|
1845
|
+
.then(commonHttpClient.castResponse())
|
|
1846
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getCustomerTransitions.response"))
|
|
1847
|
+
.then(commonHttpClient.getBody);
|
|
1848
|
+
};
|
|
1849
|
+
/**
|
|
1850
|
+
* This method retrieves a feedback of a request using it's `requestKey` or
|
|
1851
|
+
* `requestId`
|
|
1852
|
+
*
|
|
1853
|
+
* **[Permissions](#permissions) required**: User has view request permissions.
|
|
1854
|
+
*
|
|
1855
|
+
* @returns Returns the comment.
|
|
1856
|
+
*
|
|
1857
|
+
* example: {
|
|
1858
|
+
* "type": "csat",
|
|
1859
|
+
* "rating": 4,
|
|
1860
|
+
* "comment": {
|
|
1861
|
+
* "body": "Great work!"
|
|
1862
|
+
* }
|
|
1863
|
+
* }
|
|
1864
|
+
* @path {GET} /rest/servicedeskapi/request/{requestIdOrKey}/feedback
|
|
1865
|
+
* @scopes-current read:servicedesk-request
|
|
1866
|
+
* @scopes-beta read:request.feedback:jira-service-management, read:user:jira
|
|
1867
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-requestidorkey-feedback-get
|
|
1868
|
+
*/
|
|
1869
|
+
this.getFeedback = ({ requestIdOrKey, }) => {
|
|
1870
|
+
return this.getClientInstance()
|
|
1871
|
+
.request({
|
|
1872
|
+
path: "/rest/servicedeskapi/request/{requestIdOrKey}/feedback",
|
|
1873
|
+
method: "GET",
|
|
1874
|
+
pathParams: {
|
|
1875
|
+
requestIdOrKey,
|
|
1876
|
+
},
|
|
1877
|
+
})
|
|
1878
|
+
.then(this.getClientInstance().responseHandler({
|
|
1879
|
+
200: {
|
|
1880
|
+
"application/json": "json",
|
|
1881
|
+
},
|
|
1882
|
+
}))
|
|
1883
|
+
.then(commonHttpClient.castResponse())
|
|
1884
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getFeedback.response"))
|
|
1885
|
+
.then(commonHttpClient.getBody);
|
|
1886
|
+
};
|
|
1887
|
+
/**
|
|
1888
|
+
* This method returns details of a customer request's comment.
|
|
1889
|
+
*
|
|
1890
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
1891
|
+
* request.
|
|
1892
|
+
*
|
|
1893
|
+
* **Response limitations**: Customers can only view public comments on requests
|
|
1894
|
+
* where they are the reporter or a participant whereas agents can see both
|
|
1895
|
+
* internal and public comments.
|
|
1896
|
+
*
|
|
1897
|
+
* @returns Returns the comment.
|
|
1898
|
+
*
|
|
1899
|
+
* example: {
|
|
1900
|
+
* "_expands": [
|
|
1901
|
+
* "attachment",
|
|
1902
|
+
* "renderedBody"
|
|
1903
|
+
* ],
|
|
1904
|
+
* "id": "1000",
|
|
1905
|
+
* "body": "Hello there",
|
|
1906
|
+
* "public": true,
|
|
1907
|
+
* "author": {
|
|
1908
|
+
* "accountId":
|
|
1909
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1910
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1911
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1912
|
+
* "emailAddress": "fred@example.com",
|
|
1913
|
+
* "displayName": "Fred F. User",
|
|
1914
|
+
* "active": true,
|
|
1915
|
+
* "timeZone": "Australia/Sydney",
|
|
1916
|
+
* "_links": {
|
|
1917
|
+
* "jiraRest":
|
|
1918
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
1919
|
+
* "avatarUrls": {
|
|
1920
|
+
* "16x16":
|
|
1921
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
1922
|
+
* "24x24":
|
|
1923
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
1924
|
+
* "32x32":
|
|
1925
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
1926
|
+
* "48x48":
|
|
1927
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
1928
|
+
* },
|
|
1929
|
+
* "self":
|
|
1930
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
1931
|
+
* }
|
|
1932
|
+
* },
|
|
1933
|
+
* "created": {
|
|
1934
|
+
* "epochMillis": 1444360920000,
|
|
1935
|
+
* "friendly": "Today 10:22 AM",
|
|
1936
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
1937
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
1938
|
+
* },
|
|
1939
|
+
* "_links": {
|
|
1940
|
+
* "self":
|
|
1941
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2000/comment/1000"
|
|
1942
|
+
* }
|
|
1943
|
+
* }
|
|
1944
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/comment/{commentId}
|
|
1945
|
+
* @scopes-current read:servicedesk-request
|
|
1946
|
+
* @scopes-beta read:request.comment:jira-service-management, read:user:jira
|
|
1947
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-comment-commentid-get
|
|
1948
|
+
*/
|
|
1949
|
+
this.getRequestCommentById = ({ issueIdOrKey, commentId, expand, }) => {
|
|
1950
|
+
return this.getClientInstance()
|
|
1951
|
+
.request({
|
|
1952
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/comment/{commentId}",
|
|
1953
|
+
method: "GET",
|
|
1954
|
+
pathParams: {
|
|
1955
|
+
issueIdOrKey,
|
|
1956
|
+
commentId,
|
|
1957
|
+
},
|
|
1958
|
+
query: {
|
|
1959
|
+
expand,
|
|
1960
|
+
},
|
|
1961
|
+
})
|
|
1962
|
+
.then(this.getClientInstance().responseHandler({
|
|
1963
|
+
200: {
|
|
1964
|
+
"application/json": "json",
|
|
1965
|
+
},
|
|
1966
|
+
}))
|
|
1967
|
+
.then(commonHttpClient.castResponse())
|
|
1968
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getRequestCommentById.response"))
|
|
1969
|
+
.then(commonHttpClient.getBody);
|
|
1970
|
+
};
|
|
1971
|
+
/**
|
|
1972
|
+
* This method returns all comments on a customer request. No permissions error is
|
|
1973
|
+
* provided if, for example, the user doesn't have access to the service desk or
|
|
1974
|
+
* request, the method simply returns an empty response.
|
|
1975
|
+
*
|
|
1976
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
1977
|
+
* request.
|
|
1978
|
+
*
|
|
1979
|
+
* **Response limitations**: Customers are returned public comments only.
|
|
1980
|
+
*
|
|
1981
|
+
* @returns Returns the comments, on the specified page of the results.
|
|
1982
|
+
*
|
|
1983
|
+
* example: {
|
|
1984
|
+
* "_expands": [],
|
|
1985
|
+
* "size": 1,
|
|
1986
|
+
* "start": 1,
|
|
1987
|
+
* "limit": 1,
|
|
1988
|
+
* "isLastPage": false,
|
|
1989
|
+
* "_links": {
|
|
1990
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
1991
|
+
* "context": "context",
|
|
1992
|
+
* "next":
|
|
1993
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2000/comment?start=2&limit=1",
|
|
1994
|
+
* "prev":
|
|
1995
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2000/comment?start=0&limit=1"
|
|
1996
|
+
* },
|
|
1997
|
+
* "values": [
|
|
1998
|
+
* {
|
|
1999
|
+
* "_expands": [
|
|
2000
|
+
* "attachment",
|
|
2001
|
+
* "renderedBody"
|
|
2002
|
+
* ],
|
|
2003
|
+
* "id": "1000",
|
|
2004
|
+
* "body": "Hello there",
|
|
2005
|
+
* "public": true,
|
|
2006
|
+
* "author": {
|
|
2007
|
+
* "accountId":
|
|
2008
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2009
|
+
* "name":
|
|
2010
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2011
|
+
* "key":
|
|
2012
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2013
|
+
* "emailAddress": "fred@example.com",
|
|
2014
|
+
* "displayName": "Fred F. User",
|
|
2015
|
+
* "active": true,
|
|
2016
|
+
* "timeZone": "Australia/Sydney",
|
|
2017
|
+
* "_links": {
|
|
2018
|
+
* "jiraRest":
|
|
2019
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2020
|
+
* "avatarUrls": {
|
|
2021
|
+
* "16x16":
|
|
2022
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
2023
|
+
* "24x24":
|
|
2024
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
2025
|
+
* "32x32":
|
|
2026
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
2027
|
+
* "48x48":
|
|
2028
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
2029
|
+
* },
|
|
2030
|
+
* "self":
|
|
2031
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
2032
|
+
* }
|
|
2033
|
+
* },
|
|
2034
|
+
* "created": {
|
|
2035
|
+
* "epochMillis": 1444360920000,
|
|
2036
|
+
* "friendly": "Today 10:22 AM",
|
|
2037
|
+
* "iso8601": "2015-10-09T10:22:00+0700",
|
|
2038
|
+
* "jira": "2015-10-09T10:22:00.000+0700"
|
|
2039
|
+
* },
|
|
2040
|
+
* "_links": {
|
|
2041
|
+
* "self":
|
|
2042
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/2000/comment/1000"
|
|
2043
|
+
* }
|
|
2044
|
+
* }
|
|
2045
|
+
* ]
|
|
2046
|
+
* }
|
|
2047
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/comment
|
|
2048
|
+
* @scopes-current read:servicedesk-request
|
|
2049
|
+
* @scopes-beta read:request.comment:jira-service-management, read:user:jira
|
|
2050
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-comment-get
|
|
2051
|
+
*/
|
|
2052
|
+
this.getRequestComments = ({ issueIdOrKey, public: publicQuery, internal, expand, start, limit, }) => {
|
|
2053
|
+
return this.getClientInstance()
|
|
2054
|
+
.request({
|
|
2055
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/comment",
|
|
2056
|
+
method: "GET",
|
|
2057
|
+
pathParams: {
|
|
2058
|
+
issueIdOrKey,
|
|
2059
|
+
},
|
|
2060
|
+
query: {
|
|
2061
|
+
public: publicQuery,
|
|
2062
|
+
internal,
|
|
2063
|
+
expand,
|
|
2064
|
+
start,
|
|
2065
|
+
limit,
|
|
2066
|
+
},
|
|
2067
|
+
})
|
|
2068
|
+
.then(this.getClientInstance().responseHandler({
|
|
2069
|
+
200: {
|
|
2070
|
+
"application/json": "json",
|
|
2071
|
+
},
|
|
2072
|
+
}))
|
|
2073
|
+
.then(commonHttpClient.castResponse())
|
|
2074
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getRequestComments.response"))
|
|
2075
|
+
.then(commonHttpClient.getBody);
|
|
2076
|
+
};
|
|
2077
|
+
/**
|
|
2078
|
+
* This method returns a list of all the participants on a customer request.
|
|
2079
|
+
*
|
|
2080
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
2081
|
+
* request.
|
|
2082
|
+
*
|
|
2083
|
+
* @returns Returns the customer request's participants, on the specified page of the
|
|
2084
|
+
* results.
|
|
2085
|
+
*
|
|
2086
|
+
* example: {
|
|
2087
|
+
* "_expands": [],
|
|
2088
|
+
* "size": 1,
|
|
2089
|
+
* "start": 1,
|
|
2090
|
+
* "limit": 1,
|
|
2091
|
+
* "isLastPage": false,
|
|
2092
|
+
* "_links": {
|
|
2093
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
2094
|
+
* "context": "context",
|
|
2095
|
+
* "next":
|
|
2096
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1000/participant?start=2&limit=1",
|
|
2097
|
+
* "prev":
|
|
2098
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1000/participant?start=0&limit=1"
|
|
2099
|
+
* },
|
|
2100
|
+
* "values": [
|
|
2101
|
+
* {
|
|
2102
|
+
* "accountId":
|
|
2103
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2104
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2105
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2106
|
+
* "emailAddress": "fred@example.com",
|
|
2107
|
+
* "displayName": "Fred F. User",
|
|
2108
|
+
* "active": true,
|
|
2109
|
+
* "timeZone": "Australia/Sydney",
|
|
2110
|
+
* "_links": {
|
|
2111
|
+
* "jiraRest":
|
|
2112
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2113
|
+
* "avatarUrls": {
|
|
2114
|
+
* "16x16":
|
|
2115
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
2116
|
+
* "24x24":
|
|
2117
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
2118
|
+
* "32x32":
|
|
2119
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
2120
|
+
* "48x48":
|
|
2121
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
2122
|
+
* },
|
|
2123
|
+
* "self":
|
|
2124
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
2125
|
+
* }
|
|
2126
|
+
* }
|
|
2127
|
+
* ]
|
|
2128
|
+
* }
|
|
2129
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/participant
|
|
2130
|
+
* @scopes-current read:servicedesk-request
|
|
2131
|
+
* @scopes-beta read:request.participant:jira-service-management, read:user:jira
|
|
2132
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-participant-get
|
|
2133
|
+
*/
|
|
2134
|
+
this.getRequestParticipants = ({ issueIdOrKey, start, limit, }) => {
|
|
2135
|
+
return this.getClientInstance()
|
|
2136
|
+
.request({
|
|
2137
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/participant",
|
|
2138
|
+
method: "GET",
|
|
2139
|
+
pathParams: {
|
|
2140
|
+
issueIdOrKey,
|
|
2141
|
+
},
|
|
2142
|
+
query: {
|
|
2143
|
+
start,
|
|
2144
|
+
limit,
|
|
2145
|
+
},
|
|
2146
|
+
})
|
|
2147
|
+
.then(this.getClientInstance().responseHandler({
|
|
2148
|
+
200: {
|
|
2149
|
+
"application/json": "json",
|
|
2150
|
+
},
|
|
2151
|
+
}))
|
|
2152
|
+
.then(commonHttpClient.castResponse())
|
|
2153
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getRequestParticipants.response"))
|
|
2154
|
+
.then(commonHttpClient.getBody);
|
|
2155
|
+
};
|
|
2156
|
+
/**
|
|
2157
|
+
* This method returns all the SLA records on a customer request. A customer
|
|
2158
|
+
* request can have zero or more SLAs. Each SLA can have recordings for zero or
|
|
2159
|
+
* more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes
|
|
2160
|
+
* information on when it started and stopped, and whether it breached the SLA
|
|
2161
|
+
* goal.
|
|
2162
|
+
*
|
|
2163
|
+
* **[Permissions](#permissions) required**: Agent for the Service Desk containing
|
|
2164
|
+
* the queried customer request.
|
|
2165
|
+
*
|
|
2166
|
+
* @returns Returns the SLA records on the customer request, on the specified page of the
|
|
2167
|
+
* results.
|
|
2168
|
+
*
|
|
2169
|
+
* example: {
|
|
2170
|
+
* "_expands": [],
|
|
2171
|
+
* "size": 3,
|
|
2172
|
+
* "start": 3,
|
|
2173
|
+
* "limit": 3,
|
|
2174
|
+
* "isLastPage": false,
|
|
2175
|
+
* "_links": {
|
|
2176
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
2177
|
+
* "context": "context",
|
|
2178
|
+
* "next":
|
|
2179
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/101102/sla?start=6&limit=3",
|
|
2180
|
+
* "prev":
|
|
2181
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/101102/sla?start=0&limit=3"
|
|
2182
|
+
* },
|
|
2183
|
+
* "values": [
|
|
2184
|
+
* {
|
|
2185
|
+
* "name": "Time To First Response",
|
|
2186
|
+
* "_links": {
|
|
2187
|
+
* "self":
|
|
2188
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/101102/sla/10030"
|
|
2189
|
+
* },
|
|
2190
|
+
* "completedCycles": [
|
|
2191
|
+
* {
|
|
2192
|
+
* "startTime": {
|
|
2193
|
+
* "epochMillis": 1444362323000,
|
|
2194
|
+
* "friendly": "Yesterday 10:45 AM",
|
|
2195
|
+
* "iso8601": "2015-10-09T10:45:23+0700",
|
|
2196
|
+
* "jira": "2015-10-09T10:45:23.000+0700"
|
|
2197
|
+
* },
|
|
2198
|
+
* "stopTime": {
|
|
2199
|
+
* "epochMillis": 1444362743000,
|
|
2200
|
+
* "friendly": "Yesterday 10:52 AM",
|
|
2201
|
+
* "iso8601": "2015-10-09T10:52:23+0700",
|
|
2202
|
+
* "jira": "2015-10-09T10:52:23.000+0700"
|
|
2203
|
+
* },
|
|
2204
|
+
* "breachTime": {
|
|
2205
|
+
* "epochMillis": 1444362623000,
|
|
2206
|
+
* "friendly": "Yesterday 10:50 AM",
|
|
2207
|
+
* "iso8601": "2015-10-09T10:50:23+0700",
|
|
2208
|
+
* "jira": "2015-10-09T10:50:23.000+0700"
|
|
2209
|
+
* },
|
|
2210
|
+
* "breached": false,
|
|
2211
|
+
* "goalDuration": {
|
|
2212
|
+
* "millis": 14400000,
|
|
2213
|
+
* "friendly": "4h 240m"
|
|
2214
|
+
* },
|
|
2215
|
+
* "elapsedTime": {
|
|
2216
|
+
* "millis": 420000,
|
|
2217
|
+
* "friendly": "0h 7m"
|
|
2218
|
+
* },
|
|
2219
|
+
* "remainingTime": {
|
|
2220
|
+
* "millis": 13980000,
|
|
2221
|
+
* "friendly": "3h 233m"
|
|
2222
|
+
* }
|
|
2223
|
+
* },
|
|
2224
|
+
* {
|
|
2225
|
+
* "startTime": {
|
|
2226
|
+
* "epochMillis": 1444449143000,
|
|
2227
|
+
* "friendly": "Today 10:52 AM",
|
|
2228
|
+
* "iso8601": "2015-10-10T10:52:23+0700",
|
|
2229
|
+
* "jira": "2015-10-10T10:52:23.000+0700"
|
|
2230
|
+
* },
|
|
2231
|
+
* "stopTime": {
|
|
2232
|
+
* "epochMillis": 1444468523000,
|
|
2233
|
+
* "friendly": "Today 16:15 PM",
|
|
2234
|
+
* "iso8601": "2015-10-10T16:15:23+0700",
|
|
2235
|
+
* "jira": "2015-10-10T16:15:23.000+0700"
|
|
2236
|
+
* },
|
|
2237
|
+
* "breachTime": {
|
|
2238
|
+
* "epochMillis": 1444464743000,
|
|
2239
|
+
* "friendly": "Today 15:12 PM",
|
|
2240
|
+
* "iso8601": "2015-10-10T15:12:23+0700",
|
|
2241
|
+
* "jira": "2015-10-10T15:12:23.000+0700"
|
|
2242
|
+
* },
|
|
2243
|
+
* "breached": true,
|
|
2244
|
+
* "goalDuration": {
|
|
2245
|
+
* "millis": 14400000,
|
|
2246
|
+
* "friendly": "4h 240m"
|
|
2247
|
+
* },
|
|
2248
|
+
* "elapsedTime": {
|
|
2249
|
+
* "millis": 19380000,
|
|
2250
|
+
* "friendly": "5h 323m"
|
|
2251
|
+
* },
|
|
2252
|
+
* "remainingTime": {
|
|
2253
|
+
* "millis": -4980000,
|
|
2254
|
+
* "friendly": "-1h -83m"
|
|
2255
|
+
* }
|
|
2256
|
+
* }
|
|
2257
|
+
* ],
|
|
2258
|
+
* "ongoingCycle": {
|
|
2259
|
+
* "startTime": {
|
|
2260
|
+
* "epochMillis": 1444479323000,
|
|
2261
|
+
* "friendly": "Today 19:15 PM",
|
|
2262
|
+
* "iso8601": "2015-10-10T19:15:23+0700",
|
|
2263
|
+
* "jira": "2015-10-10T19:15:23.000+0700"
|
|
2264
|
+
* },
|
|
2265
|
+
* "breached": false,
|
|
2266
|
+
* "paused": false,
|
|
2267
|
+
* "withinCalendarHours": false,
|
|
2268
|
+
* "goalDuration": {
|
|
2269
|
+
* "millis": 14400000,
|
|
2270
|
+
* "friendly": "4h 240m"
|
|
2271
|
+
* },
|
|
2272
|
+
* "elapsedTime": {
|
|
2273
|
+
* "millis": 5640000,
|
|
2274
|
+
* "friendly": "1h 94m"
|
|
2275
|
+
* },
|
|
2276
|
+
* "remainingTime": {
|
|
2277
|
+
* "millis": 8760000,
|
|
2278
|
+
* "friendly": "2h 146m"
|
|
2279
|
+
* }
|
|
2280
|
+
* }
|
|
2281
|
+
* },
|
|
2282
|
+
* {
|
|
2283
|
+
* "name": "Time To Resolution",
|
|
2284
|
+
* "_links": {
|
|
2285
|
+
* "self":
|
|
2286
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/101102/sla/10040"
|
|
2287
|
+
* },
|
|
2288
|
+
* "completedCycles": [
|
|
2289
|
+
* {
|
|
2290
|
+
* "startTime": {
|
|
2291
|
+
* "epochMillis": 1444362323000,
|
|
2292
|
+
* "friendly": "Yesterday 10:45 AM",
|
|
2293
|
+
* "iso8601": "2015-10-09T10:45:23+0700",
|
|
2294
|
+
* "jira": "2015-10-09T10:45:23.000+0700"
|
|
2295
|
+
* },
|
|
2296
|
+
* "stopTime": {
|
|
2297
|
+
* "epochMillis": 1444398743000,
|
|
2298
|
+
* "friendly": "Yesterday 20:52 PM",
|
|
2299
|
+
* "iso8601": "2015-10-09T20:52:23+0700",
|
|
2300
|
+
* "jira": "2015-10-09T20:52:23.000+0700"
|
|
2301
|
+
* },
|
|
2302
|
+
* "breachTime": {
|
|
2303
|
+
* "epochMillis": 1444398623000,
|
|
2304
|
+
* "friendly": "Yesterday 20:50 PM",
|
|
2305
|
+
* "iso8601": "2015-10-09T20:50:23+0700",
|
|
2306
|
+
* "jira": "2015-10-09T20:50:23.000+0700"
|
|
2307
|
+
* },
|
|
2308
|
+
* "breached": false,
|
|
2309
|
+
* "goalDuration": {
|
|
2310
|
+
* "millis": 72000000,
|
|
2311
|
+
* "friendly": "20h 1200m"
|
|
2312
|
+
* },
|
|
2313
|
+
* "elapsedTime": {
|
|
2314
|
+
* "millis": 36420000,
|
|
2315
|
+
* "friendly": "10h 607m"
|
|
2316
|
+
* },
|
|
2317
|
+
* "remainingTime": {
|
|
2318
|
+
* "millis": 35580000,
|
|
2319
|
+
* "friendly": "9h 593m"
|
|
2320
|
+
* }
|
|
2321
|
+
* },
|
|
2322
|
+
* {
|
|
2323
|
+
* "startTime": {
|
|
2324
|
+
* "epochMillis": 1444485143000,
|
|
2325
|
+
* "friendly": "Today 20:52 PM",
|
|
2326
|
+
* "iso8601": "2015-10-10T20:52:23+0700",
|
|
2327
|
+
* "jira": "2015-10-10T20:52:23.000+0700"
|
|
2328
|
+
* },
|
|
2329
|
+
* "stopTime": {
|
|
2330
|
+
* "epochMillis": 1444504523000,
|
|
2331
|
+
* "friendly": "Today 02:15 AM",
|
|
2332
|
+
* "iso8601": "2015-10-11T02:15:23+0700",
|
|
2333
|
+
* "jira": "2015-10-11T02:15:23.000+0700"
|
|
2334
|
+
* },
|
|
2335
|
+
* "breachTime": {
|
|
2336
|
+
* "epochMillis": 1444500743000,
|
|
2337
|
+
* "friendly": "Today 01:12 AM",
|
|
2338
|
+
* "iso8601": "2015-10-11T01:12:23+0700",
|
|
2339
|
+
* "jira": "2015-10-11T01:12:23.000+0700"
|
|
2340
|
+
* },
|
|
2341
|
+
* "breached": true,
|
|
2342
|
+
* "goalDuration": {
|
|
2343
|
+
* "millis": 72000000,
|
|
2344
|
+
* "friendly": "20h 1200m"
|
|
2345
|
+
* },
|
|
2346
|
+
* "elapsedTime": {
|
|
2347
|
+
* "millis": 19380000,
|
|
2348
|
+
* "friendly": "5h 323m"
|
|
2349
|
+
* },
|
|
2350
|
+
* "remainingTime": {
|
|
2351
|
+
* "millis": 52620000,
|
|
2352
|
+
* "friendly": "14h 877m"
|
|
2353
|
+
* }
|
|
2354
|
+
* }
|
|
2355
|
+
* ],
|
|
2356
|
+
* "ongoingCycle": {
|
|
2357
|
+
* "startTime": {
|
|
2358
|
+
* "epochMillis": 1444515323000,
|
|
2359
|
+
* "friendly": "Today 05:15 AM",
|
|
2360
|
+
* "iso8601": "2015-10-11T05:15:23+0700",
|
|
2361
|
+
* "jira": "2015-10-11T05:15:23.000+0700"
|
|
2362
|
+
* },
|
|
2363
|
+
* "breached": false,
|
|
2364
|
+
* "paused": false,
|
|
2365
|
+
* "withinCalendarHours": false,
|
|
2366
|
+
* "goalDuration": {
|
|
2367
|
+
* "millis": 72000000,
|
|
2368
|
+
* "friendly": "20h 1200m"
|
|
2369
|
+
* },
|
|
2370
|
+
* "elapsedTime": {
|
|
2371
|
+
* "millis": 5640000,
|
|
2372
|
+
* "friendly": "1h 94m"
|
|
2373
|
+
* },
|
|
2374
|
+
* "remainingTime": {
|
|
2375
|
+
* "millis": 66360000,
|
|
2376
|
+
* "friendly": "18h 1106m"
|
|
2377
|
+
* }
|
|
2378
|
+
* }
|
|
2379
|
+
* },
|
|
2380
|
+
* {
|
|
2381
|
+
* "name": "Time To Retrospective",
|
|
2382
|
+
* "_links": {
|
|
2383
|
+
* "self":
|
|
2384
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/101102/sla/10050"
|
|
2385
|
+
* },
|
|
2386
|
+
* "completedCycles": [
|
|
2387
|
+
* {
|
|
2388
|
+
* "startTime": {
|
|
2389
|
+
* "epochMillis": 1444362323000,
|
|
2390
|
+
* "friendly": "Yesterday 10:45 AM",
|
|
2391
|
+
* "iso8601": "2015-10-09T10:45:23+0700",
|
|
2392
|
+
* "jira": "2015-10-09T10:45:23.000+0700"
|
|
2393
|
+
* },
|
|
2394
|
+
* "stopTime": {
|
|
2395
|
+
* "epochMillis": 1444449143000,
|
|
2396
|
+
* "friendly": "Yesterday 10:52 AM",
|
|
2397
|
+
* "iso8601": "2015-10-10T10:52:23+0700",
|
|
2398
|
+
* "jira": "2015-10-10T10:52:23.000+0700"
|
|
2399
|
+
* },
|
|
2400
|
+
* "breachTime": {
|
|
2401
|
+
* "epochMillis": 1444449023000,
|
|
2402
|
+
* "friendly": "Yesterday 10:50 AM",
|
|
2403
|
+
* "iso8601": "2015-10-10T10:50:23+0700",
|
|
2404
|
+
* "jira": "2015-10-10T10:50:23.000+0700"
|
|
2405
|
+
* },
|
|
2406
|
+
* "breached": false,
|
|
2407
|
+
* "goalDuration": {
|
|
2408
|
+
* "millis": 144000000,
|
|
2409
|
+
* "friendly": "40h 2400m"
|
|
2410
|
+
* },
|
|
2411
|
+
* "elapsedTime": {
|
|
2412
|
+
* "millis": 86820000,
|
|
2413
|
+
* "friendly": "24h 1447m"
|
|
2414
|
+
* },
|
|
2415
|
+
* "remainingTime": {
|
|
2416
|
+
* "millis": 57180000,
|
|
2417
|
+
* "friendly": "15h 953m"
|
|
2418
|
+
* }
|
|
2419
|
+
* },
|
|
2420
|
+
* {
|
|
2421
|
+
* "startTime": {
|
|
2422
|
+
* "epochMillis": 1444535543000,
|
|
2423
|
+
* "friendly": "Today 10:52 AM",
|
|
2424
|
+
* "iso8601": "2015-10-11T10:52:23+0700",
|
|
2425
|
+
* "jira": "2015-10-11T10:52:23.000+0700"
|
|
2426
|
+
* },
|
|
2427
|
+
* "stopTime": {
|
|
2428
|
+
* "epochMillis": 1444554923000,
|
|
2429
|
+
* "friendly": "Today 16:15 PM",
|
|
2430
|
+
* "iso8601": "2015-10-11T16:15:23+0700",
|
|
2431
|
+
* "jira": "2015-10-11T16:15:23.000+0700"
|
|
2432
|
+
* },
|
|
2433
|
+
* "breachTime": {
|
|
2434
|
+
* "epochMillis": 1444551143000,
|
|
2435
|
+
* "friendly": "Today 15:12 PM",
|
|
2436
|
+
* "iso8601": "2015-10-11T15:12:23+0700",
|
|
2437
|
+
* "jira": "2015-10-11T15:12:23.000+0700"
|
|
2438
|
+
* },
|
|
2439
|
+
* "breached": true,
|
|
2440
|
+
* "goalDuration": {
|
|
2441
|
+
* "millis": 144000000,
|
|
2442
|
+
* "friendly": "40h 2400m"
|
|
2443
|
+
* },
|
|
2444
|
+
* "elapsedTime": {
|
|
2445
|
+
* "millis": 19380000,
|
|
2446
|
+
* "friendly": "5h 323m"
|
|
2447
|
+
* },
|
|
2448
|
+
* "remainingTime": {
|
|
2449
|
+
* "millis": 124620000,
|
|
2450
|
+
* "friendly": "34h 2077m"
|
|
2451
|
+
* }
|
|
2452
|
+
* }
|
|
2453
|
+
* ],
|
|
2454
|
+
* "ongoingCycle": {
|
|
2455
|
+
* "startTime": {
|
|
2456
|
+
* "epochMillis": 1444565723000,
|
|
2457
|
+
* "friendly": "Today 19:15 PM",
|
|
2458
|
+
* "iso8601": "2015-10-11T19:15:23+0700",
|
|
2459
|
+
* "jira": "2015-10-11T19:15:23.000+0700"
|
|
2460
|
+
* },
|
|
2461
|
+
* "breached": false,
|
|
2462
|
+
* "paused": false,
|
|
2463
|
+
* "withinCalendarHours": false,
|
|
2464
|
+
* "goalDuration": {
|
|
2465
|
+
* "millis": 144000000,
|
|
2466
|
+
* "friendly": "40h 2400m"
|
|
2467
|
+
* },
|
|
2468
|
+
* "elapsedTime": {
|
|
2469
|
+
* "millis": 5640000,
|
|
2470
|
+
* "friendly": "1h 94m"
|
|
2471
|
+
* },
|
|
2472
|
+
* "remainingTime": {
|
|
2473
|
+
* "millis": 138360000,
|
|
2474
|
+
* "friendly": "38h 2306m"
|
|
2475
|
+
* }
|
|
2476
|
+
* }
|
|
2477
|
+
* }
|
|
2478
|
+
* ]
|
|
2479
|
+
* }
|
|
2480
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/sla
|
|
2481
|
+
* @scopes-current read:jira-work
|
|
2482
|
+
* @scopes-beta read:request.sla:jira-service-management
|
|
2483
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-sla-get
|
|
2484
|
+
*/
|
|
2485
|
+
this.getSlaInformation = ({ issueIdOrKey, start, limit, }) => {
|
|
2486
|
+
return this.getClientInstance()
|
|
2487
|
+
.request({
|
|
2488
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/sla",
|
|
2489
|
+
method: "GET",
|
|
2490
|
+
pathParams: {
|
|
2491
|
+
issueIdOrKey,
|
|
2492
|
+
},
|
|
2493
|
+
query: {
|
|
2494
|
+
start,
|
|
2495
|
+
limit,
|
|
2496
|
+
},
|
|
2497
|
+
})
|
|
2498
|
+
.then(this.getClientInstance().responseHandler({
|
|
2499
|
+
200: {
|
|
2500
|
+
"application/json": "json",
|
|
2501
|
+
},
|
|
2502
|
+
}))
|
|
2503
|
+
.then(commonHttpClient.castResponse())
|
|
2504
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getSlaInformation.response"))
|
|
2505
|
+
.then(commonHttpClient.getBody);
|
|
2506
|
+
};
|
|
2507
|
+
/**
|
|
2508
|
+
* This method returns the details for an SLA on a customer request.
|
|
2509
|
+
*
|
|
2510
|
+
* **[Permissions](#permissions) required**: Agent for the Service Desk containing
|
|
2511
|
+
* the queried customer request.
|
|
2512
|
+
*
|
|
2513
|
+
* @returns Returns the SLA record, on the specified page of the results.
|
|
2514
|
+
*
|
|
2515
|
+
* example: {
|
|
2516
|
+
* "name": "Time To First Response",
|
|
2517
|
+
* "_links": {
|
|
2518
|
+
* "self":
|
|
2519
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/101102/sla/10030"
|
|
2520
|
+
* },
|
|
2521
|
+
* "completedCycles": [
|
|
2522
|
+
* {
|
|
2523
|
+
* "startTime": {
|
|
2524
|
+
* "epochMillis": 1444362323000,
|
|
2525
|
+
* "friendly": "Yesterday 10:45 AM",
|
|
2526
|
+
* "iso8601": "2015-10-09T10:45:23+0700",
|
|
2527
|
+
* "jira": "2015-10-09T10:45:23.000+0700"
|
|
2528
|
+
* },
|
|
2529
|
+
* "stopTime": {
|
|
2530
|
+
* "epochMillis": 1444362743000,
|
|
2531
|
+
* "friendly": "Yesterday 10:52 AM",
|
|
2532
|
+
* "iso8601": "2015-10-09T10:52:23+0700",
|
|
2533
|
+
* "jira": "2015-10-09T10:52:23.000+0700"
|
|
2534
|
+
* },
|
|
2535
|
+
* "breachTime": {
|
|
2536
|
+
* "epochMillis": 1444362623000,
|
|
2537
|
+
* "friendly": "Yesterday 10:50 AM",
|
|
2538
|
+
* "iso8601": "2015-10-09T10:50:23+0700",
|
|
2539
|
+
* "jira": "2015-10-09T10:50:23.000+0700"
|
|
2540
|
+
* },
|
|
2541
|
+
* "breached": false,
|
|
2542
|
+
* "goalDuration": {
|
|
2543
|
+
* "millis": 14400000,
|
|
2544
|
+
* "friendly": "4h 240m"
|
|
2545
|
+
* },
|
|
2546
|
+
* "elapsedTime": {
|
|
2547
|
+
* "millis": 420000,
|
|
2548
|
+
* "friendly": "0h 7m"
|
|
2549
|
+
* },
|
|
2550
|
+
* "remainingTime": {
|
|
2551
|
+
* "millis": 13980000,
|
|
2552
|
+
* "friendly": "3h 233m"
|
|
2553
|
+
* }
|
|
2554
|
+
* },
|
|
2555
|
+
* {
|
|
2556
|
+
* "startTime": {
|
|
2557
|
+
* "epochMillis": 1444449143000,
|
|
2558
|
+
* "friendly": "Today 10:52 AM",
|
|
2559
|
+
* "iso8601": "2015-10-10T10:52:23+0700",
|
|
2560
|
+
* "jira": "2015-10-10T10:52:23.000+0700"
|
|
2561
|
+
* },
|
|
2562
|
+
* "stopTime": {
|
|
2563
|
+
* "epochMillis": 1444468523000,
|
|
2564
|
+
* "friendly": "Today 16:15 PM",
|
|
2565
|
+
* "iso8601": "2015-10-10T16:15:23+0700",
|
|
2566
|
+
* "jira": "2015-10-10T16:15:23.000+0700"
|
|
2567
|
+
* },
|
|
2568
|
+
* "breachTime": {
|
|
2569
|
+
* "epochMillis": 1444464743000,
|
|
2570
|
+
* "friendly": "Today 15:12 PM",
|
|
2571
|
+
* "iso8601": "2015-10-10T15:12:23+0700",
|
|
2572
|
+
* "jira": "2015-10-10T15:12:23.000+0700"
|
|
2573
|
+
* },
|
|
2574
|
+
* "breached": true,
|
|
2575
|
+
* "goalDuration": {
|
|
2576
|
+
* "millis": 14400000,
|
|
2577
|
+
* "friendly": "4h 240m"
|
|
2578
|
+
* },
|
|
2579
|
+
* "elapsedTime": {
|
|
2580
|
+
* "millis": 19380000,
|
|
2581
|
+
* "friendly": "5h 323m"
|
|
2582
|
+
* },
|
|
2583
|
+
* "remainingTime": {
|
|
2584
|
+
* "millis": -4980000,
|
|
2585
|
+
* "friendly": "-1h -83m"
|
|
2586
|
+
* }
|
|
2587
|
+
* }
|
|
2588
|
+
* ],
|
|
2589
|
+
* "ongoingCycle": {
|
|
2590
|
+
* "startTime": {
|
|
2591
|
+
* "epochMillis": 1444479323000,
|
|
2592
|
+
* "friendly": "Today 19:15 PM",
|
|
2593
|
+
* "iso8601": "2015-10-10T19:15:23+0700",
|
|
2594
|
+
* "jira": "2015-10-10T19:15:23.000+0700"
|
|
2595
|
+
* },
|
|
2596
|
+
* "breached": false,
|
|
2597
|
+
* "paused": false,
|
|
2598
|
+
* "withinCalendarHours": false,
|
|
2599
|
+
* "goalDuration": {
|
|
2600
|
+
* "millis": 14400000,
|
|
2601
|
+
* "friendly": "4h 240m"
|
|
2602
|
+
* },
|
|
2603
|
+
* "elapsedTime": {
|
|
2604
|
+
* "millis": 5640000,
|
|
2605
|
+
* "friendly": "1h 94m"
|
|
2606
|
+
* },
|
|
2607
|
+
* "remainingTime": {
|
|
2608
|
+
* "millis": 8760000,
|
|
2609
|
+
* "friendly": "2h 146m"
|
|
2610
|
+
* }
|
|
2611
|
+
* }
|
|
2612
|
+
* }
|
|
2613
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/sla/{slaMetricId}
|
|
2614
|
+
* @scopes-current read:jira-work
|
|
2615
|
+
* @scopes-beta read:request.sla:jira-service-management
|
|
2616
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-sla-slametricid-get
|
|
2617
|
+
*/
|
|
2618
|
+
this.getSlaInformationById = ({ issueIdOrKey, slaMetricId, }) => {
|
|
2619
|
+
return this.getClientInstance()
|
|
2620
|
+
.request({
|
|
2621
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/sla/{slaMetricId}",
|
|
2622
|
+
method: "GET",
|
|
2623
|
+
pathParams: {
|
|
2624
|
+
issueIdOrKey,
|
|
2625
|
+
slaMetricId,
|
|
2626
|
+
},
|
|
2627
|
+
})
|
|
2628
|
+
.then(this.getClientInstance().responseHandler({
|
|
2629
|
+
200: {
|
|
2630
|
+
"application/json": "json",
|
|
2631
|
+
},
|
|
2632
|
+
}))
|
|
2633
|
+
.then(commonHttpClient.castResponse())
|
|
2634
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getSlaInformationById.response"))
|
|
2635
|
+
.then(commonHttpClient.getBody);
|
|
2636
|
+
};
|
|
2637
|
+
/**
|
|
2638
|
+
* This method returns the notification subscription status of the user making the
|
|
2639
|
+
* request. Use this method to determine if the user is subscribed to a customer
|
|
2640
|
+
* request's notifications.
|
|
2641
|
+
*
|
|
2642
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
2643
|
+
* request.
|
|
2644
|
+
*
|
|
2645
|
+
* @returns Returns the status of the notification subscription.
|
|
2646
|
+
*
|
|
2647
|
+
* example: {
|
|
2648
|
+
* "subscribed": true
|
|
2649
|
+
* }
|
|
2650
|
+
* @path {GET} /rest/servicedeskapi/request/{issueIdOrKey}/notification
|
|
2651
|
+
* @scopes-current read:servicedesk-request
|
|
2652
|
+
* @scopes-beta read:request.notification:jira-service-management, read:user:jira
|
|
2653
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-notification-get
|
|
2654
|
+
*/
|
|
2655
|
+
this.getSubscriptionStatus = ({ issueIdOrKey, }) => {
|
|
2656
|
+
return this.getClientInstance()
|
|
2657
|
+
.request({
|
|
2658
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/notification",
|
|
2659
|
+
method: "GET",
|
|
2660
|
+
pathParams: {
|
|
2661
|
+
issueIdOrKey,
|
|
2662
|
+
},
|
|
2663
|
+
})
|
|
2664
|
+
.then(this.getClientInstance().responseHandler({
|
|
2665
|
+
200: {
|
|
2666
|
+
"application/json": "json",
|
|
2667
|
+
},
|
|
2668
|
+
}))
|
|
2669
|
+
.then(commonHttpClient.castResponse())
|
|
2670
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.getSubscriptionStatus.response"))
|
|
2671
|
+
.then(commonHttpClient.getBody);
|
|
2672
|
+
};
|
|
2673
|
+
/**
|
|
2674
|
+
* This method performs a customer transition for a given request and transition.
|
|
2675
|
+
* An optional comment can be included to provide a reason for the transition.
|
|
2676
|
+
*
|
|
2677
|
+
* **[Permissions](#permissions) required**: The user must be able to view the
|
|
2678
|
+
* request and have the Transition Issues permission. If a comment is passed the
|
|
2679
|
+
* user must have the Add Comments permission.
|
|
2680
|
+
*
|
|
2681
|
+
* @path {POST} /rest/servicedeskapi/request/{issueIdOrKey}/transition
|
|
2682
|
+
* @scopes-current write:servicedesk-request
|
|
2683
|
+
* @scopes-beta read:request.status:jira-service-management,
|
|
2684
|
+
* write:request.status:jira-service-management, read:user:jira
|
|
2685
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-transition-post
|
|
2686
|
+
*/
|
|
2687
|
+
this.performCustomerTransition = ({ issueIdOrKey, customerTransitionExecutionDto, }) => {
|
|
2688
|
+
return this.getClientInstance()
|
|
2689
|
+
.request({
|
|
2690
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/transition",
|
|
2691
|
+
method: "POST",
|
|
2692
|
+
pathParams: {
|
|
2693
|
+
issueIdOrKey,
|
|
2694
|
+
},
|
|
2695
|
+
headers: {
|
|
2696
|
+
"Content-Type": "application/json",
|
|
2697
|
+
},
|
|
2698
|
+
body: customerTransitionExecutionDto,
|
|
2699
|
+
})
|
|
2700
|
+
.then(commonHttpClient.discardResult);
|
|
2701
|
+
};
|
|
2702
|
+
/**
|
|
2703
|
+
* This method adds a feedback on an request using it's `requestKey` or `requestId`
|
|
2704
|
+
*
|
|
2705
|
+
* **[Permissions](#permissions) required**: User must be the reporter or an
|
|
2706
|
+
* Atlassian Connect app.
|
|
2707
|
+
*
|
|
2708
|
+
* @returns Returns the comment.
|
|
2709
|
+
*
|
|
2710
|
+
* example: {
|
|
2711
|
+
* "type": "csat",
|
|
2712
|
+
* "rating": 4,
|
|
2713
|
+
* "comment": {
|
|
2714
|
+
* "body": "Great work!"
|
|
2715
|
+
* }
|
|
2716
|
+
* }
|
|
2717
|
+
* @path {POST} /rest/servicedeskapi/request/{requestIdOrKey}/feedback
|
|
2718
|
+
* @scopes-current write:servicedesk-request
|
|
2719
|
+
* @scopes-beta read:request.feedback:jira-service-management,
|
|
2720
|
+
* write:request.feedback:jira-service-management, read:user:jira
|
|
2721
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-requestidorkey-feedback-post
|
|
2722
|
+
*/
|
|
2723
|
+
this.postFeedback = ({ requestIdOrKey, csatFeedbackFullDto, }) => {
|
|
2724
|
+
return this.getClientInstance()
|
|
2725
|
+
.request({
|
|
2726
|
+
path: "/rest/servicedeskapi/request/{requestIdOrKey}/feedback",
|
|
2727
|
+
method: "POST",
|
|
2728
|
+
pathParams: {
|
|
2729
|
+
requestIdOrKey,
|
|
2730
|
+
},
|
|
2731
|
+
headers: {
|
|
2732
|
+
"Content-Type": "application/json",
|
|
2733
|
+
},
|
|
2734
|
+
body: csatFeedbackFullDto,
|
|
2735
|
+
})
|
|
2736
|
+
.then(this.getClientInstance().responseHandler({
|
|
2737
|
+
201: {
|
|
2738
|
+
"application/json": "json",
|
|
2739
|
+
},
|
|
2740
|
+
}))
|
|
2741
|
+
.then(commonHttpClient.castResponse())
|
|
2742
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.postFeedback.response"))
|
|
2743
|
+
.then(commonHttpClient.getBody);
|
|
2744
|
+
};
|
|
2745
|
+
/**
|
|
2746
|
+
* This method removes participants from a customer request.
|
|
2747
|
+
*
|
|
2748
|
+
* **[Permissions](#permissions) required**: Permission to manage participants on
|
|
2749
|
+
* the customer request.
|
|
2750
|
+
*
|
|
2751
|
+
* @returns Returns the first page of the customer request's participants (after removal of
|
|
2752
|
+
* the users).
|
|
2753
|
+
*
|
|
2754
|
+
* example: {
|
|
2755
|
+
* "_expands": [],
|
|
2756
|
+
* "size": 1,
|
|
2757
|
+
* "start": 1,
|
|
2758
|
+
* "limit": 1,
|
|
2759
|
+
* "isLastPage": false,
|
|
2760
|
+
* "_links": {
|
|
2761
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
2762
|
+
* "context": "context",
|
|
2763
|
+
* "next":
|
|
2764
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1000/participant?start=2&limit=1",
|
|
2765
|
+
* "prev":
|
|
2766
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/request/1000/participant?start=0&limit=1"
|
|
2767
|
+
* },
|
|
2768
|
+
* "values": [
|
|
2769
|
+
* {
|
|
2770
|
+
* "accountId":
|
|
2771
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2772
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2773
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2774
|
+
* "emailAddress": "fred@example.com",
|
|
2775
|
+
* "displayName": "Fred F. User",
|
|
2776
|
+
* "active": true,
|
|
2777
|
+
* "timeZone": "Australia/Sydney",
|
|
2778
|
+
* "_links": {
|
|
2779
|
+
* "jiraRest":
|
|
2780
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
2781
|
+
* "avatarUrls": {
|
|
2782
|
+
* "16x16":
|
|
2783
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
2784
|
+
* "24x24":
|
|
2785
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
2786
|
+
* "32x32":
|
|
2787
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
2788
|
+
* "48x48":
|
|
2789
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
2790
|
+
* },
|
|
2791
|
+
* "self":
|
|
2792
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
2793
|
+
* }
|
|
2794
|
+
* }
|
|
2795
|
+
* ]
|
|
2796
|
+
* }
|
|
2797
|
+
* @path {DELETE} /rest/servicedeskapi/request/{issueIdOrKey}/participant
|
|
2798
|
+
* @scopes-current write:servicedesk-request
|
|
2799
|
+
* @scopes-beta read:request.participant:jira-service-management,
|
|
2800
|
+
* delete:request.participant:jira-service-management, read:user:jira
|
|
2801
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-participant-delete
|
|
2802
|
+
*/
|
|
2803
|
+
this.removeRequestParticipants = ({ issueIdOrKey, requestParticipantUpdateDto, }) => {
|
|
2804
|
+
return this.getClientInstance()
|
|
2805
|
+
.request({
|
|
2806
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/participant",
|
|
2807
|
+
method: "DELETE",
|
|
2808
|
+
pathParams: {
|
|
2809
|
+
issueIdOrKey,
|
|
2810
|
+
},
|
|
2811
|
+
headers: {
|
|
2812
|
+
"Content-Type": "application/json",
|
|
2813
|
+
},
|
|
2814
|
+
body: requestParticipantUpdateDto,
|
|
2815
|
+
})
|
|
2816
|
+
.then(this.getClientInstance().responseHandler({
|
|
2817
|
+
200: {
|
|
2818
|
+
"application/json": "json",
|
|
2819
|
+
},
|
|
2820
|
+
}))
|
|
2821
|
+
.then(commonHttpClient.castResponse())
|
|
2822
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("RequestService.removeRequestParticipants.response"))
|
|
2823
|
+
.then(commonHttpClient.getBody);
|
|
2824
|
+
};
|
|
2825
|
+
/**
|
|
2826
|
+
* This method subscribes the user to receiving notifications from a customer
|
|
2827
|
+
* request.
|
|
2828
|
+
*
|
|
2829
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
2830
|
+
* request.
|
|
2831
|
+
*
|
|
2832
|
+
* @path {PUT} /rest/servicedeskapi/request/{issueIdOrKey}/notification
|
|
2833
|
+
* @scopes-current write:servicedesk-request
|
|
2834
|
+
* @scopes-beta read:request.notification:jira-service-management,
|
|
2835
|
+
* write:request.notification:jira-service-management, read:user:jira
|
|
2836
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-notification-put
|
|
2837
|
+
*/
|
|
2838
|
+
this.subscribe = ({ issueIdOrKey, }) => {
|
|
2839
|
+
return this.getClientInstance()
|
|
2840
|
+
.request({
|
|
2841
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/notification",
|
|
2842
|
+
method: "PUT",
|
|
2843
|
+
pathParams: {
|
|
2844
|
+
issueIdOrKey,
|
|
2845
|
+
},
|
|
2846
|
+
})
|
|
2847
|
+
.then(commonHttpClient.discardResult);
|
|
2848
|
+
};
|
|
2849
|
+
/**
|
|
2850
|
+
* This method unsubscribes the user from notifications from a customer request.
|
|
2851
|
+
*
|
|
2852
|
+
* **[Permissions](#permissions) required**: Permission to view the customer
|
|
2853
|
+
* request.
|
|
2854
|
+
*
|
|
2855
|
+
* @path {DELETE} /rest/servicedeskapi/request/{issueIdOrKey}/notification
|
|
2856
|
+
* @scopes-current write:servicedesk-request
|
|
2857
|
+
* @scopes-beta read:request.notification:jira-service-management,
|
|
2858
|
+
* delete:request.notification:jira-service-management, read:user:jira
|
|
2859
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request#api-rest-servicedeskapi-request-issueidorkey-notification-delete
|
|
2860
|
+
*/
|
|
2861
|
+
this.unsubscribe = ({ issueIdOrKey, }) => {
|
|
2862
|
+
return this.getClientInstance()
|
|
2863
|
+
.request({
|
|
2864
|
+
path: "/rest/servicedeskapi/request/{issueIdOrKey}/notification",
|
|
2865
|
+
method: "DELETE",
|
|
2866
|
+
pathParams: {
|
|
2867
|
+
issueIdOrKey,
|
|
2868
|
+
},
|
|
2869
|
+
})
|
|
2870
|
+
.then(commonHttpClient.discardResult);
|
|
2871
|
+
};
|
|
2872
|
+
}
|
|
2873
|
+
static initialize() {
|
|
2874
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getCustomerRequests.response", zod_1.z
|
|
2875
|
+
.object({
|
|
2876
|
+
status: zod_1.z.literal(200),
|
|
2877
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2878
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoCustomerRequestDto"),
|
|
2879
|
+
})
|
|
2880
|
+
.describe("RequestService.getCustomerRequests.response"));
|
|
2881
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.createCustomerRequest.response", zod_1.z
|
|
2882
|
+
.object({
|
|
2883
|
+
status: zod_1.z.literal(201),
|
|
2884
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2885
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("CustomerRequestDto"),
|
|
2886
|
+
})
|
|
2887
|
+
.describe("RequestService.createCustomerRequest.response"));
|
|
2888
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getCustomerRequestByIdOrKey.response", zod_1.z
|
|
2889
|
+
.object({
|
|
2890
|
+
status: zod_1.z.literal(200),
|
|
2891
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2892
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("CustomerRequestDto"),
|
|
2893
|
+
})
|
|
2894
|
+
.describe("RequestService.getCustomerRequestByIdOrKey.response"));
|
|
2895
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getApprovals.response", zod_1.z
|
|
2896
|
+
.object({
|
|
2897
|
+
status: zod_1.z.literal(200),
|
|
2898
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2899
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoApprovalDto"),
|
|
2900
|
+
})
|
|
2901
|
+
.describe("RequestService.getApprovals.response"));
|
|
2902
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getApprovalById.response", zod_1.z
|
|
2903
|
+
.object({
|
|
2904
|
+
status: zod_1.z.literal(200),
|
|
2905
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2906
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("ApprovalDto"),
|
|
2907
|
+
})
|
|
2908
|
+
.describe("RequestService.getApprovalById.response"));
|
|
2909
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.answerApproval.response", zod_1.z
|
|
2910
|
+
.object({
|
|
2911
|
+
status: zod_1.z.literal(200),
|
|
2912
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2913
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("ApprovalDto"),
|
|
2914
|
+
})
|
|
2915
|
+
.describe("RequestService.answerApproval.response"));
|
|
2916
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getAttachmentsForRequest.response", zod_1.z
|
|
2917
|
+
.object({
|
|
2918
|
+
status: zod_1.z.literal(200),
|
|
2919
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2920
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoAttachmentDto"),
|
|
2921
|
+
})
|
|
2922
|
+
.describe("RequestService.getAttachmentsForRequest.response"));
|
|
2923
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.createCommentWithAttachment.response", zod_1.z
|
|
2924
|
+
.object({
|
|
2925
|
+
status: zod_1.z.literal(201),
|
|
2926
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2927
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("AttachmentCreateResultDto"),
|
|
2928
|
+
})
|
|
2929
|
+
.describe("RequestService.createCommentWithAttachment.response"));
|
|
2930
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getAttachmentContent.response", zod_1.z
|
|
2931
|
+
.object({
|
|
2932
|
+
status: zod_1.z.literal(200),
|
|
2933
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2934
|
+
body: zod_1.z.unknown(),
|
|
2935
|
+
})
|
|
2936
|
+
.describe("RequestService.getAttachmentContent.response"));
|
|
2937
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getAttachmentThumbnail.response", zod_1.z
|
|
2938
|
+
.object({
|
|
2939
|
+
status: zod_1.z.literal(200),
|
|
2940
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2941
|
+
body: zod_1.z.unknown(),
|
|
2942
|
+
})
|
|
2943
|
+
.describe("RequestService.getAttachmentThumbnail.response"));
|
|
2944
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getRequestComments.response", zod_1.z
|
|
2945
|
+
.object({
|
|
2946
|
+
status: zod_1.z.literal(200),
|
|
2947
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2948
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoCommentDto"),
|
|
2949
|
+
})
|
|
2950
|
+
.describe("RequestService.getRequestComments.response"));
|
|
2951
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.createRequestComment.response", zod_1.z
|
|
2952
|
+
.object({
|
|
2953
|
+
status: zod_1.z.literal(201),
|
|
2954
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2955
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("CommentDto"),
|
|
2956
|
+
})
|
|
2957
|
+
.describe("RequestService.createRequestComment.response"));
|
|
2958
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getRequestCommentById.response", zod_1.z
|
|
2959
|
+
.object({
|
|
2960
|
+
status: zod_1.z.literal(200),
|
|
2961
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2962
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("CommentDto"),
|
|
2963
|
+
})
|
|
2964
|
+
.describe("RequestService.getRequestCommentById.response"));
|
|
2965
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getCommentAttachments.response", zod_1.z
|
|
2966
|
+
.object({
|
|
2967
|
+
status: zod_1.z.literal(200),
|
|
2968
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2969
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoAttachmentDto"),
|
|
2970
|
+
})
|
|
2971
|
+
.describe("RequestService.getCommentAttachments.response"));
|
|
2972
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getSubscriptionStatus.response", zod_1.z
|
|
2973
|
+
.object({
|
|
2974
|
+
status: zod_1.z.literal(200),
|
|
2975
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2976
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("RequestNotificationSubscriptionDto"),
|
|
2977
|
+
})
|
|
2978
|
+
.describe("RequestService.getSubscriptionStatus.response"));
|
|
2979
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getRequestParticipants.response", zod_1.z
|
|
2980
|
+
.object({
|
|
2981
|
+
status: zod_1.z.literal(200),
|
|
2982
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2983
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoUserDto"),
|
|
2984
|
+
})
|
|
2985
|
+
.describe("RequestService.getRequestParticipants.response"));
|
|
2986
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.addRequestParticipants.response", zod_1.z
|
|
2987
|
+
.object({
|
|
2988
|
+
status: zod_1.z.literal(200),
|
|
2989
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2990
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoUserDto"),
|
|
2991
|
+
})
|
|
2992
|
+
.describe("RequestService.addRequestParticipants.response"));
|
|
2993
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.removeRequestParticipants.response", zod_1.z
|
|
2994
|
+
.object({
|
|
2995
|
+
status: zod_1.z.literal(200),
|
|
2996
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
2997
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoUserDto"),
|
|
2998
|
+
})
|
|
2999
|
+
.describe("RequestService.removeRequestParticipants.response"));
|
|
3000
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getSlaInformation.response", zod_1.z
|
|
3001
|
+
.object({
|
|
3002
|
+
status: zod_1.z.literal(200),
|
|
3003
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3004
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoSlaInformationDto"),
|
|
3005
|
+
})
|
|
3006
|
+
.describe("RequestService.getSlaInformation.response"));
|
|
3007
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getSlaInformationById.response", zod_1.z
|
|
3008
|
+
.object({
|
|
3009
|
+
status: zod_1.z.literal(200),
|
|
3010
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3011
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("SlaInformationDto"),
|
|
3012
|
+
})
|
|
3013
|
+
.describe("RequestService.getSlaInformationById.response"));
|
|
3014
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getCustomerRequestStatus.response", zod_1.z
|
|
3015
|
+
.object({
|
|
3016
|
+
status: zod_1.z.literal(200),
|
|
3017
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3018
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoCustomerRequestStatusDto"),
|
|
3019
|
+
})
|
|
3020
|
+
.describe("RequestService.getCustomerRequestStatus.response"));
|
|
3021
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getCustomerTransitions.response", zod_1.z
|
|
3022
|
+
.object({
|
|
3023
|
+
status: zod_1.z.literal(200),
|
|
3024
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3025
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoCustomerTransitionDto"),
|
|
3026
|
+
})
|
|
3027
|
+
.describe("RequestService.getCustomerTransitions.response"));
|
|
3028
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.getFeedback.response", zod_1.z
|
|
3029
|
+
.object({
|
|
3030
|
+
status: zod_1.z.literal(200),
|
|
3031
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3032
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("CsatFeedbackFullDto"),
|
|
3033
|
+
})
|
|
3034
|
+
.describe("RequestService.getFeedback.response"));
|
|
3035
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.postFeedback.response", zod_1.z
|
|
3036
|
+
.object({
|
|
3037
|
+
status: zod_1.z.literal(201),
|
|
3038
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3039
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("CsatFeedbackFullDto"),
|
|
3040
|
+
})
|
|
3041
|
+
.describe("RequestService.postFeedback.response"));
|
|
3042
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("RequestService.deleteFeedback.response", zod_1.z
|
|
3043
|
+
.object({
|
|
3044
|
+
status: zod_1.z.literal(204),
|
|
3045
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
3046
|
+
body: zod_1.z.unknown(),
|
|
3047
|
+
})
|
|
3048
|
+
.describe("RequestService.deleteFeedback.response"));
|
|
3049
|
+
validationSchemaStorage_1.validationSchemaStorage.registerOnce([
|
|
3050
|
+
request_1.registerRequestValidationSchemas,
|
|
3051
|
+
common_1.registerCommonValidationSchemas,
|
|
3052
|
+
]);
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
exports.RequestService = RequestService;
|
|
3056
|
+
//# sourceMappingURL=RequestService.js.map
|