Jira REST API
You can use Jira REST API to work with the checklists ā”ļø
š Overview
You can read/write checklists by accessing any of checklist storage:
Use Checklists Custom Field. Read more about custom fields setup here ā "Checklists" Custom Field set up
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 here ā Ā Manage API tokens for your Atlassian account | Atlassian Support
Then use the following approach.
Using com.railsware.SmartChecklist.checklist
issue property:
š Jira API reference
Set the checklist
curl --location --request PUT \
--url 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/properties/com.railsware.SmartChecklist.checklist' \
--user 'email@example.com:<api_token>' \
--headerĀ 'Accept: application/json' \
--dataĀ '"- ToDo List\n+ Checked\nx Skipped\n~ In Progress\n"'
Get the checklist
curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/properties/com.railsware.SmartChecklist.checklist' \
--user 'email@example.com:<api_token>' \
--headerĀ 'Accept: application/json' \
Using Checklists custom field
š Jira API reference
āš¼NOTE: customfield_10001
custom field id might be different on your instance. Make sure you use the correct one
Set the checklist
curl --request PUT \
--url 'https://your-domain.atlassian.net/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
Check an example implementationĀ withĀ ScriptRunner for Jira (Cloud)
Ā
Hope everything works for you! š