Table of contents
...
Our plugin allows you to change it's data via Atlassian API. We use the properties of the issue so you can get, update, delete or create data outside of the plugin UI.
You can preview the data by making a GET request to: https://{ site-url }.atlassian.net/rest/api/2/issue/{ issue.id }/properties/sd-checklists-0
PUT requests are also made to the same endpoint.
If you have a lot of checklists, you may need to call GET
Code Block |
---|
https://{ site-url }.atlassian.net/rest/api/2/issue/{ issue.id }/properties |
to check if there are properties like sd-checklists-1, sd-checklists-2 that contain checklists that did not fit into sd-checklists-0
If your project permission is not set to "anyone" you will need an API Token. You can generate it here: https://id.atlassian.com/manage/api-tokens
...
https://{ site-url }.atlassian.net/rest/api/2/issue/{ issue.id }/properties/sd-checklists-0 - read/update/delete the checklist
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -u { your email }:{ your API token } https://{ site-url }.atlassian.net/rest/api/2/issue/{ issue.id }/properties/sd-checklists-0 |
How to add/update checklist:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -X PUT -H "Content-Type: application/json" -u { your email }:{ your API token } https://{ site-url }.atlassian.net/rest/api/2/issue/{ issue.id }/properties/sd-checklists-0 -d '{
"version":"1.0.0",
"checklists":[
{
"id":0,
"name":"Example to do",
"items":[
{
"name":"<p>task 1</p>",
"required":true,
"completed":true,
"status":0,
"user":"{ user id }",
"date":"2019-08-13T13:18:24.046Z"
},
{
"name":"<p>task 2</p>",
"required":false,
"completed":true,
"status":0,
"user":"{ user id }",
"date":"2019-08-13T13:18:44.988Z"
},
{
"name":"<p>task 3</p>",
"required":false,
"completed":false,
"status":0,
"user":"{ user id }",
"date":"2019-08-08T13:30:29.643Z"
}
]
}
]
}' |
...
Code Block | ||||
---|---|---|---|---|
| ||||
curl -X PUT -H "Content-Type: application/json" -u { your email }:{ your API token } https://{ site-url }.atlassian.net/rest/api/2/issue/{ issue.id }/properties/sd-checklists-0 -d '{}' |
Examples with Postman:
...