Versions Compared

Key

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


Info

This guide is based on Jira built-in automation functionality.

...

Info

The guide works for Classic projects only. Next-gen projects are too limited and do not support automation features.


Info

You will need to modify the regular expression if you have custom checklist statuses for checked items. For example, if you have a custom status named "finished", replace "x|done|skipped" with "x|done|skipped|finished".

Prerequisites

"Save checklist data to Jira custom fields" option must be enabled in Issue Checklist Global Settings

...

  1. Go to Automation listing page (it is either Project settings > Project automationAutomation or Jira Settings > System > Automation rules) and press Create rule button:
    Image Removed
    Image Added

  2. On the New trigger page, Select Field value changed option:
    Image Removed
    Image Added

  3. On the Field value changed page select Checklist Content YAML (Field)Text in the first list and then select Edit issue in the second list. Next, press Save button:
    Image Removed
    Image Added

  4. On the New component the Add component page select New condition option:
    Image Removed
    Image Added

  5. One the New condition page select if / else block option:
    Image Removed
    Image Added

  6. On the If block page press Add conditions... link and next select Advanced compare condition:
    Image Removed
    Image Added


  7. On the next If block page enter following details in the form:
    1. {{issue.customfield_1204310268}}
    2. contains regular expression
    3. .*- text: Test(\r\n|\r|\n|\W).*checked: true.*(?m)^\*\s+\[(x|done|skipped)\]\s+Test

    Where:
    (1) customfield_12043 is 10268 is an ID of Checklist Content YAML Text custom field that you must replace with value from your Jira. Read how to find custom field ID.
    (2) Test is a text/summary of checklist item that we want to test for checked status (replace it with summary of your checklist item).
    Image Removed
    Image Added

    Press Save when finished.

  8. On the New component page select New action option:
    Image Removed
    Image Added

  9. On the New action page select Edit issue option:
    Image Removed
    Image Added

  10. On the Edit issue page select Label field from the dropdown, change form option to Add/remove values and provide a label that you want to add to an issue:
    Image Removed
    Image Added 
    Image RemovedImage Added Image Removed Image Added

    Press Save when ready.

  11. On the Add component page select Add else option:
    Image Removed
    Image Added

  12. On the Else block page press Add conditions... link and next select Advanced compare condition:
    Image Removed
    Image Added

  13. On the next Else block page enter following details in the form:
    1. {{issue.customfield_1204310268}}
    2. contains regular expression
    3. .*- text: Test(\r\n|\r|\n|\W).*checked: false.*(?m)^\*\s+\[(?!x|done|skipped).*\]\s+Test

    Where:
    (1) customfield_12043 is 10268 is an ID of Checklist Content YAML Text custom field. Read how to find custom field ID.
    (2) Test is a text/summary of checklist item that we want to test for unchecked status.

    Please note that the regular expression from point (c) contains false phrase as oppose to differs from the one in (7c) which contains true
    Image Removed
    Image Added

    Press Save when finished.

  14. On the New component page select New action option:
    Image Removed
    Image Added 

  15. On the New action page select Edit issue option:
    Image Removed
    Image Added

  16. On the Edit issue page select Label field from the dropdown, change form option to Add/remove values and provide a label that you want to remove from an issue:
    Image Removed
    Image Added 
    Image RemovedImage Added Image RemovedImage Added

    Press Save when ready.

  17. The rule configuration is complete. Press Publish rule button and provide Provide a name for the rule and press Turn it on button:
    Image Removed
    Image Added

  18. Test the setup and enjoy (smile)

    1. Go to any issue page, add "Test" item and:
      1. check the Test item to notice label "Test_checked" added to issue
      2. uncheck the Test item to notice label "Test_checked" removed from the issue
      3. check/uncheck other items to notice that label "Text_checked" is not affected

    Image Modified


Info
titleTip

In point 12 you can skip clicking Add conditions... link and jump directly to point 14. This way label "Test_checked" will be removed not only when Test item becomes unchecked but also when it is deleted.

...