Jira REST API
You can use Jira REST API to work with the checklists ⚡️
Contents 👇🏻
☝🏼IMPORTANT NOTE: In the Forge app, updating the checklist via issue properties is no longer supported. Use the Checklists custom field to update checklists instead.
📖 Overview
You can work with checklists through Checklists custom field which can be used for both read and write actions → Custom Fields Guide
🔒 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
References
🔗 Jira API reference
Then use the following approach:
Operation | Method | Endpoint | Data in the request body |
|---|---|---|---|
Using | |||
Get the checklist from existing Jira issue | GET |
|
|
Using Checklists custom field | |||
Get the checklist from existing Jira issue | GET |
|
|
Set the checklist for existing Jira issue | PUT |
|
|
Create Jira issue with the checklist applied | POST |
|
|
Examples
Reading com.railsware.SmartChecklist.checklist issue property:
Get the checklist GET /rest/api/2/issue/{issueIdOrKey}/properties/{propertyKey}
Retrieves an existing list of checklists for the given issue key
Using cURL:
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 PUT /rest/api/2/issue/{issueIdOrKey}
Set a checklist for the given issue key
Using cURL:
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 GET /rest/api/2/issue/
Retrieves an existing list of checklists for the given issue key
Using cURL:
curl --request GET \
--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' Check an example implementation with ScriptRunner for Jira (Cloud)
Hope everything works for you! 🚀