You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 20 Next »
You can use Jira REST API to work with the checklists.
You can read/write checklists by accessing any of checklist storage:
use “Checklists” custom fields. 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.
com.railsware.SmartChecklist.checklist
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
Jira API reference
curl --location --request PUT \ --url 'https://your-domain.atlassian.com/rest/api/2/issue/{issueIdOrKey}/properties/com.railsware.SmartChecklist.checklist' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '"- ToDo List\n+ Checked\nx Skipped\n~ In Progress\n"'
curl --request GET \ --url 'https://your-domain.atlassian.com/rest/api/2/issue/{issueIdOrKey}/properties/com.railsware.SmartChecklist.checklist' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json'
customfield_10001 custom field id might be different on your instance. Make sure you use the correct one.
customfield_10001
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" } }'
Your curl request
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'
Check an example implementation with ScriptRunner for Jira (Cloud)