Jira REST API

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

🔗 Properties REST APIs

🔗 Issue REST APIs

Then use the following approach:

 

Operation

Method

Endpoint

Data in the request body

Operation

Method

Endpoint

Data in the request body

Using com.railsware.SmartChecklist.checklist issue property

Get the checklist from existing Jira issue

GET

/rest/api/2/issue/{issueIdOrKey}/properties/com.railsware.SmartChecklist.checklist

 

Using Checklists custom field

Get the checklist from existing Jira issue

GET

/rest/api/2/issue/{issueIdOrKey}

 

Set the checklist for existing Jira issue

PUT

/rest/api/2/issue/{issueIdOrKey}

"fields": {"customfield_10001": "- ToDo List\n+ Checked\nx Skipped\n~ In Progress\n" }

Create Jira issue with the checklist applied

POST

/rest/api/2/issue/

"fields": {"customfield_10001": "- ToDo List\n+ Checked\nx Skipped\n~ In Progress\n" }

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

Method: GET

Endpoint URL: https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/properties/{propertyKey}

Path parameters

  • issueIdOrKey: number or issue key (required)

  • propertyKey: com.railsware.SmartChecklist.checklist (required)

 

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

Method: PUT

Endpoint URL: https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}

Path parameters

  • issueIdOrKey: number or issue key (required)

Body parameters (application/json):

  • "customfield_10001": string (required)

Example:

{ "fields": { "customfield_10001": "- ToDo List\n+ Checked\nx Skipped\n~ In Progress\n" } }

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

Method: GET

Endpoint URL: https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}

Path parameters

  • issueIdOrKey: number or issue key (required)

 

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! 🚀