It is possible to add or update checklist items in Automation using our REST API.
If you want to import a template, you should use our automation action for importing a template into a Checklist.
Steps
Create an Edit Issue rule.
The Checklist field type is not available in the list of fields. You must open More options and configure the values in Additional fields using our REST API.
Examples
The following examples are updating a checklist field named Checklist. You must use your own field name in place.
Adding items
Status | ||
---|---|---|
|
Using the add update operation.
Code Block |
---|
{ "update": { "Checklist": [ { "add": [ { "name": "Added item 1" }, { "name": "Added item 2" } ] } ] } } |
Setting items (overwrites the checklist)
Using the set update operation.
Code Block |
---|
{ "update": { "Checklist": [ { "set": [ { "name": "Develop" }, { "name": "Test" } ] } ] } } |
Updating existing items
Status | ||
---|---|---|
|
Using the edit update operation and looping over the existing items of the checklist.
This example checks all items in the checklist.
Code Block |
---|
{ "update": { "Checklist": [ { "edit": [ {{#Checklist}} { "id": {{id}}, "checked": true } {{^last}},{{/}} {{/}} ] } ] } } |
Conditionally updating existing items
Status | ||
---|---|---|
|
Using the edit update operation and by looping conditionally over the existing items of the checklist.
This example sets the status
Status | ||
---|---|---|
|
Code Block |
---|
{ "update": { "Checklist": [ { "edit": [ {{#Checklist}} { "id": {{id}} {{#if(not(checked))}}, "status": { "id": "notApplicable" } {{/}} } {{^last}},{{/}} {{/}} ] } ] } } |
Status | ||
---|---|---|
|