Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

  1. Create an Edit Issue rule.

  2. 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
titleAVAILABLE SINCE 5.2.0

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
titleAVAILABLE SINCE 5.2.0

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
titleAVAILABLE SINCE 5.2.0

Using the edit update operation and by looping conditionally over the existing items of the checklist.

This example sets the status

Status
titleN/A
to every unchecked item of the checklist.

Code Block
{
    "update": {
        "Checklist": [
            {
                "edit": [
                    {{#Checklist}}
                        {
                            "id": {{id}}
                            {{#if(not(checked))}},
                            "status": {
                                "id": "notApplicable"
                            }
                            {{/}}
                        }
                        {{^last}},{{/}}
                    {{/}}
                ]
            }
        ]
    }
}

Status
titleSERVER documentation
(On Cloud? Go here.)
Have questions? Contact our Service Desk for help anytime.