Table of Contents | ||||
---|---|---|---|---|
|
...
You can use the Jira REST API to interact with the Issue Checklist. This page documents the REST resources available to use, including example requests and responses. Use this API to build script interactions with your checklist, or develop any other type of integration.
Note |
---|
|
Note |
|
...
|
Requirements
To use Issue Checklists with the API, the Save checklist data to Jira custom fields global setting must be enabled.
To update or remove an existing checklist via the API, the Checklist Text custom field must be present on the Edit issue screen. Follow these instructions for adding a custom field to a screen.
No configuration are required for reading a checklist, or checklist metadata via the API.
...
Item | Replace with | Example |
---|---|---|
The email address provided in your Atlassian ID account | ||
| A valid API token for your Atlassian ID |
|
The URL of your Jira Cloud instance |
| |
| The relevant issue key |
|
| The ID of the Checklist Text custom field in your instance. Follow these instructions for getting the custom field ID. |
|
...
Get, Update or Remove Checklist
Note |
---|
You will need to replace the custom field ID with the ID of the Checklist Text fieldin your instance. |
Get a Checklist
GET /rest/api/2/issue/{issueIdOrKey} (reference)
Returns the details of an issue, including the checklist in text format.
...
Code Block | ||
---|---|---|
| ||
{ "expand": "", "id": "10002", "self": "https://your-domain.atlassian.net/rest/api/2/issue/10002", "key": "DEMO-1", "fields": { (...) // omitted for brevity "customfield_10034XXXXX": "--- Tested on\n* Chrome\n* Safari\n* Firefox\n* Edge\n* [x] IE11", } (...) // omitted for brevity } |
...
Create or Update a Checklist
PUT /rest/api/2/issue/{issueIdOrKey} (reference)
Updates the issue by adding or updating a formatted checklist.
...
Code Block | ||
---|---|---|
| ||
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_10034XXXXX": "--- Tested on\n* [x] Chrome\n* Safari\n* Firefox\n* Edge\n* [x] IE11\n--- Mobile\n* Android\n* iPhone" } }' |
...
Code Block | ||
---|---|---|
| ||
{"errorMessages":[],"errors":{"customfield_10034":"Field 'customfield_10034XXXXX' cannot be set. It is not on the appropriate screen, or unknown."}} |
...
Code Block |
---|
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_10034XXXXX": null } }' |
Read, Modify & Update Checklists
...
Retrieve a representation of the issue via
GET /rest/api/2/issue/{issueIdOrKey}
Using Checklist Text field id, extract and parse checklist value:
representation
→fields
→customfield_xxxxx XXXXX
(parse items by new line characters)Modify the parsed checklist as needed. For example, to check an item as complete, put an "x" in the square brackets (so that "* [] summary" becomes "* [x] summary").
Upload the modified value back to the issue via
PUT /rest/api/2/issue/{issueIdOrKey}
...
Expand | ||||
---|---|---|---|---|
| ||||
|
...
Info |
---|
Note that the API can also be used to retrieve checklist metadata stored in issue entity properties. Note that entity properties will reflect the sum of both local and global checklists on the issue. |