You can use Jira REST API to work with the checklists.
Overview
You can read/write checklists by
...
using Jira REST API accessing a “Checklists” custom field.
Info |
---|
Read more about custom fields used by Smart Checklist addon and their setup here: Custom Fields |
...
use com.railsware.SmartChecklist.checklist
Issue property which is immediately available upon addon setup.
Authentication
Get your API token from https://id.atlassian.com/manage/api-tokens check out instructions: https://confluence.atlassian.com/cloud/api-tokens-938839638.html
Then use the following approach
Examples
Using com.railsware.SmartChecklist.checklist issue property
...
Method | API reference |
---|---|
Get checklist value rom existing Jira issue | Use the Get Issue Jira REST API |
Create Jira issue with the checklist applied | Use the Create Issue Jira REST API |
Set the checklist for existing Jira issue | Use the Edit Issue Jira REST API |
References
Checklist Format
Use checklist RAW text Markdown format to set its value. Check the Formatting Guide for more info.
Example
Set the checklist
Code Block |
---|
...
| ||
"customfield_10001": "- ToDo List\n+ Checked\nx Skipped\n~ In Progress\ |
...
Get the checklist
...
n# Another ToDo List\n- Unchecked\n> Quote line 1 https:// |
...
Using “Checklists” custom field
Jira API reference
...
rw.rw\\n> Quote line 2\n> Quote line 3\n" |
Note |
---|
Custom field id |
Set the checklist
Code Block |
---|
curl --request PUT \
--url 'https://your-domain.atlassian.com/rest/api/2/issue/{issueIdOrKey}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"customfield_10001": "- ToDo List\n+ Checked\nx Skipped\n~ In Progress\n"
}
}' |
Get the checklist
Your curl request
Code Block |
---|
curl --request GET \
--url 'https://your-domain.atlassian.com/rest/api/2/issue/{issueIdOrKey}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' |
Response from server
...
Here’s How to find id for custom field “Checklist” on Jira Server and Data Center. |
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|