RM-JIRA API Calls and JSON Schemas-220225-233711
RM-JIRA API Calls and JSON Schemas-220225-233711
API Calls:
The implemented calls to the Jira API are as follows:
Projects:
When retrieving the projects via the Get Projects Paginated endpoint, we get the following response:
1 {
2 "isLast": false,
3 "maxResults": 2,
4 "nextPage": "https://your-domain.atlassian.net/rest/api/3/project/search?startAt=2&maxResults=2",
5 "self": "https://your-domain.atlassian.net/rest/api/3/project/search?startAt=0&maxResults=2",
6 "startAt": 0,
7 "total": 7,
8 "values": [
9 {
10 "avatarUrls": {
11 "16x16": "https://your-domain.atlassian.net/secure/projectavatar?size=xsmall&pid=10000",
12 "24x24": "https://your-domain.atlassian.net/secure/projectavatar?size=small&pid=10000",
13 "32x32": "https://your-domain.atlassian.net/secure/projectavatar?size=medium&pid=10000",
14 "48x48": "https://your-domain.atlassian.net/secure/projectavatar?size=large&pid=10000"
15 },
16 "id": "10000",
17 "insight": {
18 "lastIssueUpdateTime": "2021-04-22T05:37:05.000+0000",
19 "totalIssueCount": 100
20 },
21 "key": "EX",
22 "name": "Example",
23 "projectCategory": {
24 "description": "First Project Category",
25 "id": "10000",
26 "name": "FIRST",
27 "self": "https://your-domain.atlassian.net/rest/api/3/projectCategory/10000"
28 },
29 "self": "https://your-domain.atlassian.net/rest/api/3/project/EX",
30 "simplified": false,
31 "style": "classic"
32 },
33 {
34 "avatarUrls": {
35 "16x16": "https://your-domain.atlassian.net/secure/projectavatar?size=xsmall&pid=10001",
36 "24x24": "https://your-domain.atlassian.net/secure/projectavatar?size=small&pid=10001",
37 "32x32": "https://your-domain.atlassian.net/secure/projectavatar?size=medium&pid=10001",
38 "48x48": "https://your-domain.atlassian.net/secure/projectavatar?size=large&pid=10001"
39 },
40 "id": "10001",
41 "insight": {
42 "lastIssueUpdateTime": "2021-04-22T05:37:05.000+0000",
43 "totalIssueCount": 100
44 },
45 "key": "ABC",
46 "name": "Alphabetical",
47 "projectCategory": {
48 "description": "First Project Category",
49 "id": "10000",
50 "name": "FIRST",
51 "self": "https://your-domain.atlassian.net/rest/api/3/projectCategory/10000"
52 },
53 "self": "https://your-domain.atlassian.net/rest/api/3/project/ABC",
54 "simplified": false,
55 "style": "classic"
56 }
57 ]
58 }
Currently, the only data being used from this response are the id, key, and name for the project listing, but the description, style, avatar URLs, as well as the IssueCount
and lastIssueUpdateTime are also available in case of need.
As the retrieved data is paginated, if there are more than one page, you must iterate through all of them until the “isLast“ boolean is set as true.
Note: The self labeled data are the links pointing either to the current page, to the project, or it’s category.
The avatar URLs also have links pointing at them as they are images.
Fields:
When retrieving the fields via the Get Fields endpoint, we get the following response:
1 [
2 {
3 "clauseNames": [
4 "description"
5 ],
6 "custom": false,
7 "id": "description",
8 "name": "Description",
9 "navigable": true,
10 "orderable": true,
11 "schema": {
12 "system": "description",
13 "type": "string"
14 },
15 "searchable": true
16 },
17 {
18 "clauseNames": [
19 "summary"
20 ],
21 "custom": false,
22 "id": "summary",
23 "key": "summary",
24 "name": "Summary",
25 "navigable": true,
26 "orderable": true,
27 "schema": {
28 "system": "summary",
29 "type": "string"
30 },
31 "searchable": true
32 }
33 ]
Remember that the retrieved data consists of a list of all fields to which the provided credentials have access to. The “clauseNames“ array contains the names that can
reference a given field with an advanced search (which also includes the one in the “name“ field of the response), whereas the “custom“ boolean just tells you if a given field
is a custom field or not.
You can also know the type of the data iside the field, and the schema which said field is based on.
Note: currently we are doing a filtering of this response to get custom fields.
When retrieving the custom fields via the Get Fields Paginated endpoint with the type set to custom, we get the following response:
1 {
2 "isLast": false,
3 "maxResults": 50,
4 "startAt": 0,
5 "total": 2,
6 "values": [
7 {
8 "id": "customfield_10000",
9 "name": "Approvers",
10 "schema": {
11 "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker",
12 "customId": 10000,
13 "items": "user",
14 "type": "array"
15 },
16 "description": "Contains users needed for approval. This custom field was created by Jira Service Desk.",
17 "key": "customfield_10000",
18 "stableId": "sfid:approvers",
19 "isLocked": true,
20 "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher",
21 "screensCount": 2,
22 "contextsCount": 2,
23 "lastUsed": {
24 "type": "TRACKED",
25 "value": "2021-01-28T07:37:40.000+0000"
26 }
27 },
28 {
29 "id": "customfield_10001",
30 "name": "Change reason",
31 "schema": {
32 "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
33 "customId": 10001,
34 "type": "option"
35 },
36 "description": "Choose the reason for the change request",
37 "key": "customfield_10001",
38 "stableId": "sfid:change-reason",
39 "isLocked": false,
40 "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher",
41 "screensCount": 2,
42 "contextsCount": 2,
43 "projectsCount": 2,
44 "lastUsed": {
45 "type": "NOT_TRACKED"
46 }
47 }
48 ]
49 }
As stablished on the projects section, the pagination has a boolean that tells you wether it’s the last page or not (isLast). Also, in comparison to the Get Fields endpoint, you
can find the description of the custom field, as well as the count of how many projects, contexts and screens use said custom field.
Note: You require to have an API Token from an account with administrator Jira Global Permission to make this request.
Issues:
When retrieving the issues via the Search for issues using JQL enhanced search (GET) endpoint, we get the following response:
1 {
2 "issues": [
3 {
4 "expand": "",
5 "fields": {
6 "watcher": {
7 "isWatching": false,
8 "self": "https://your-domain.atlassian.net/rest/api/3/issue/EX-1/watchers",
9 "watchCount": 1
10 },
11 "attachment": [
12 {
13 "author": {
14 "accountId": "5b10a2844c20165700ede21g",
15 "accountType": "atlassian",
16 "active": false,
17 "avatarUrls": {
18 "16x16": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
19 "24x24": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
20 "32x32": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
21 "48x48": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
22 },
23 "displayName": "Mia Krystof",
24 "key": "",
25 "name": "",
26 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
27 },
28 "content": "https://your-domain.atlassian.net/jira/rest/api/3/attachment/content/10001",
29 "created": "2023-06-24T19:24:50.000+0000",
30 "filename": "debuglog.txt",
31 "id": 10001,
32 "mimeType": "text/plain",
33 "self": "https://your-domain.atlassian.net/rest/api/2/attachments/10001",
34 "size": 2460
35 }
36 ],
37 "sub-tasks": [
38 {
39 "id": "10000",
40 "outwardIssue": {
41 "fields": {
42 "status": {
43 "iconUrl": "https://your-domain.atlassian.net/images/icons/statuses/open.png",
44 "name": "Open"
45 }
46 },
47 "id": "10003",
48 "key": "ED-2",
49 "self": "https://your-domain.atlassian.net/rest/api/3/issue/ED-2"
50 },
51 "type": {
52 "id": "10000",
53 "inward": "Parent",
54 "name": "",
55 "outward": "Sub-task"
56 }
57 }
58 ],
59 "description": "Main order flow broken",
60 "project": {
61 "avatarUrls": {
62 "16x16": "https://your-domain.atlassian.net/secure/projectavatar?size=xsmall&pid=10000",
63 "24x24": "https://your-domain.atlassian.net/secure/projectavatar?size=small&pid=10000",
64 "32x32": "https://your-domain.atlassian.net/secure/projectavatar?size=medium&pid=10000",
65 "48x48": "https://your-domain.atlassian.net/secure/projectavatar?size=large&pid=10000"
66 },
67 "id": "10000",
68 "insight": {
69 "lastIssueUpdateTime": "2021-04-22T05:37:05.000+0000",
70 "totalIssueCount": 100
71 },
72 "key": "EX",
73 "name": "Example",
74 "projectCategory": {
75 "description": "First Project Category",
76 "id": "10000",
77 "name": "FIRST",
78 "self": "https://your-domain.atlassian.net/rest/api/3/projectCategory/10000"
79 },
80 "self": "https://your-domain.atlassian.net/rest/api/3/project/EX",
81 "simplified": false,
82 "style": "classic"
83 },
84 "comment": [
85 {
86 "author": {
87 "accountId": "5b10a2844c20165700ede21g",
88 "active": false,
89 "displayName": "Mia Krystof",
90 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
91 },
92 "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semp
93 "created": "2021-01-17T12:34:00.000+0000",
94 "id": "10000",
95 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/comment/10000",
96 "updateAuthor": {
97 "accountId": "5b10a2844c20165700ede21g",
98 "active": false,
99 "displayName": "Mia Krystof",
100 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
101 },
102 "updated": "2021-01-18T23:45:00.000+0000",
103 "visibility": {
104 "identifier": "Administrators",
105 "type": "role",
106 "value": "Administrators"
107 }
108 }
109 ],
110 "issuelinks": [
111 {
112 "id": "10001",
113 "outwardIssue": {
114 "fields": {
115 "status": {
116 "iconUrl": "https://your-domain.atlassian.net/images/icons/statuses/open.png",
117 "name": "Open"
118 }
119 },
120 "id": "10004L",
121 "key": "PR-2",
122 "self": "https://your-domain.atlassian.net/rest/api/3/issue/PR-2"
123 },
124 "type": {
125 "id": "10000",
126 "inward": "depends on",
127 "name": "Dependent",
128 "outward": "is depended by"
129 }
130 },
131 {
132 "id": "10002",
133 "inwardIssue": {
134 "fields": {
135 "status": {
136 "iconUrl": "https://your-domain.atlassian.net/images/icons/statuses/open.png",
137 "name": "Open"
138 }
139 },
140 "id": "10004",
141 "key": "PR-3",
142 "self": "https://your-domain.atlassian.net/rest/api/3/issue/PR-3"
143 },
144 "type": {
145 "id": "10000",
146 "inward": "depends on",
147 "name": "Dependent",
148 "outward": "is depended by"
149 }
150 }
151 ],
152 "worklog": [
153 {
154 "author": {
155 "accountId": "5b10a2844c20165700ede21g",
156 "active": false,
157 "displayName": "Mia Krystof",
158 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
159 },
160 "comment": "I did some work here.",
161 "id": "100028",
162 "issueId": "10002",
163 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
164 "started": "2021-01-17T12:34:00.000+0000",
165 "timeSpent": "3h 20m",
166 "timeSpentSeconds": 12000,
167 "updateAuthor": {
168 "accountId": "5b10a2844c20165700ede21g",
169 "active": false,
170 "displayName": "Mia Krystof",
171 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
172 },
173 "updated": "2021-01-18T23:45:00.000+0000",
174 "visibility": {
175 "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
176 "type": "group",
177 "value": "jira-developers"
178 }
179 }
180 ],
181 "updated": 1,
182 "timetracking": {
183 "originalEstimate": "10m",
184 "originalEstimateSeconds": 600,
185 "remainingEstimate": "3m",
186 "remainingEstimateSeconds": 200,
187 "timeSpent": "6m",
188 "timeSpentSeconds": 400
189 }
190 },
191 "id": "10002",
192 "key": "ED-1",
193 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10002"
194 }
195 ]
196 }
You can get more or less data by using the expand, fields, and jql parameters during the query (Please refer to the official documentation).
Screens:
When retrieving the custom fields via the Get Screens endpoint with the type set to custom, we get the following response:
1 {
2 "isLast": true,
3 "maxResults": 100,
4 "self": "https://your-domain.atlassian.net/rest/api/3/screens",
5 "startAt": 0,
6 "total": 3,
7 "values": [
8 {
9 "id": 1,
10 "name": "Default Screen",
11 "description": "Provides for the update all system fields."
12 },
13 {
14 "id": 2,
15 "name": "Workflow Screen",
16 "description": "This screen is used in the workflow and enables you to assign issues."
17 },
18 {
19 "id": 3,
20 "name": "Resolve Issue Screen",
21 "description": "Offers the ability to set resolution, change fix versions, and assign an issue."
22 }
23 ]
24 }
As you can see, this is a paginated response that returns the most basic data regarding a screen, there are some extra parameters you can using with the query like scope, that
adds some aditional data.
1 {
2 "id": "Project's id",
3 "name": "Project's name",
4 "key": "Project's key",
5 "custom_fields": [
6 {
7 "id": "customfield_10000",
8 "name": "Approvers",
9 "schema": {
10 "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker",
11 "customId": 10000,
12 "items": "user",
13 "type": "array"
14 },
15 "description": "Contains users needed for approval. This custom field was created by Jira Service Desk.",
16 "key": "customfield_10000",
17 "stableId": "sfid:approvers",
18 "isLocked": true,
19 "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher",
20 "screensCount": 2,
21 "contextsCount": 2,
22 "lastUsed": {
23 "type": "TRACKED",
24 "value": "2021-01-28T07:37:40.000+0000"
25 }
26 },
27 {
28 "id": "customfield_10001",
29 "name": "Change reason",
30 "schema": {
31 "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
32 "customId": 10001,
33 "type": "option"
34 },
35 "description": "Choose the reason for the change request",
36 "key": "customfield_10001",
37 "stableId": "sfid:change-reason",
38 "isLocked": false,
39 "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher",
40 "screensCount": 2,
41 "contextsCount": 2,
42 "projectsCount": 2,
43 "lastUsed": {
44 "type": "NOT_TRACKED"
45 }
46 }
47 ],
48 "issues": [
49 {
50 "fields": {
51 "watcher": {
52 "isWatching": false,
53 "self": "https://your-domain.atlassian.net/rest/api/3/issue/EX-1/watchers",
54 "watchCount": 1
55 },
56 "attachment": [
57 {
58 "author": {
59 "accountId": "5b10a2844c20165700ede21g",
60 "accountType": "atlassian",
61 "active": false,
62 "avatarUrls": {
63 "16x16": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
64 "24x24": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
65 "32x32": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
66 "48x48": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
67 },
68 "displayName": "Mia Krystof",
69 "key": "",
70 "name": "",
71 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
72 },
73 "content": "https://your-domain.atlassian.net/jira/rest/api/3/attachment/content/10001",
74 "created": "2023-06-24T19:24:50.000+0000",
75 "filename": "debuglog.txt",
76 "id": 10001,
77 "mimeType": "text/plain",
78 "self": "https://your-domain.atlassian.net/rest/api/2/attachments/10001",
79 "size": 2460
80 }
81 ],
82 "sub-tasks": [
83 {
84 "id": "10000",
85 "outwardIssue": {
86 "fields": {
87 "status": {
88 "iconUrl": "https://your-domain.atlassian.net/images/icons/statuses/open.png",
89 "name": "Open"
90 }
91 },
92 "id": "10003",
93 "key": "ED-2",
94 "self": "https://your-domain.atlassian.net/rest/api/3/issue/ED-2"
95 },
96 "type": {
97 "id": "10000",
98 "inward": "Parent",
99 "name": "",
100 "outward": "Sub-task"
101 }
102 }
103 ],
104 "description": "Main order flow broken",
105 "comment": [
106 {
107 "author": {
108 "accountId": "5b10a2844c20165700ede21g",
109 "active": false,
110 "displayName": "Mia Krystof",
111 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
112 },
113 "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semp
114 "created": "2021-01-17T12:34:00.000+0000",
115 "id": "10000",
116 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/comment/10000",
117 "updateAuthor": {
118 "accountId": "5b10a2844c20165700ede21g",
119 "active": false,
120 "displayName": "Mia Krystof",
121 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
122 },
123 "updated": "2021-01-18T23:45:00.000+0000",
124 "visibility": {
125 "identifier": "Administrators",
126 "type": "role",
127 "value": "Administrators"
128 }
129 }
130 ],
131 "issuelinks": [
132 {
133 "id": "10001",
134 "outwardIssue": {
135 "fields": {
136 "status": {
137 "iconUrl": "https://your-domain.atlassian.net/images/icons/statuses/open.png",
138 "name": "Open"
139 }
140 },
141 "id": "10004L",
142 "key": "PR-2",
143 "self": "https://your-domain.atlassian.net/rest/api/3/issue/PR-2"
144 },
145 "type": {
146 "id": "10000",
147 "inward": "depends on",
148 "name": "Dependent",
149 "outward": "is depended by"
150 }
151 },
152 {
153 "id": "10002",
154 "inwardIssue": {
155 "fields": {
156 "status": {
157 "iconUrl": "https://your-domain.atlassian.net/images/icons/statuses/open.png",
158 "name": "Open"
159 }
160 },
161 "id": "10004",
162 "key": "PR-3",
163 "self": "https://your-domain.atlassian.net/rest/api/3/issue/PR-3"
164 },
165 "type": {
166 "id": "10000",
167 "inward": "depends on",
168 "name": "Dependent",
169 "outward": "is depended by"
170 }
171 }
172 ],
173 "worklog": [
174 {
175 "author": {
176 "accountId": "5b10a2844c20165700ede21g",
177 "active": false,
178 "displayName": "Mia Krystof",
179 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
180 },
181 "comment": "I did some work here.",
182 "id": "100028",
183 "issueId": "10002",
184 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
185 "started": "2021-01-17T12:34:00.000+0000",
186 "timeSpent": "3h 20m",
187 "timeSpentSeconds": 12000,
188 "updateAuthor": {
189 "accountId": "5b10a2844c20165700ede21g",
190 "active": false,
191 "displayName": "Mia Krystof",
192 "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
193 },
194 "updated": "2021-01-18T23:45:00.000+0000",
195 "visibility": {
196 "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
197 "type": "group",
198 "value": "jira-developers"
199 }
200 }
201 ],
202 "updated": 1,
203 "timetracking": {
204 "originalEstimate": "10m",
205 "originalEstimateSeconds": 600,
206 "remainingEstimate": "3m",
207 "remainingEstimateSeconds": 200,
208 "timeSpent": "6m",
209 "timeSpentSeconds": 400
210 }
211 },
212 "id": "10002",
213 "key": "ED-1",
214 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10002"
215 }
216 ],
217 "screens": [
218 {
219 "id": 1,
220 "name": "Default Screen",
221 "description": "Provides for the update all system fields."
222 },
223 {
224 "id": 2,
225 "name": "Workflow Screen",
226 "description": "This screen is used in the workflow and enables you to assign issues."
227 },
228 {
229 "id": 3,
230 "name": "Resolve Issue Screen",
231 "description": "Offers the ability to set resolution, change fix versions, and assign an issue."
232 }
233 ]
234 }