Versions Compared

Key

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

Scenario

Div
classtime

Estimated Time: 10 min

When all the sub-tasks are completed, you would like to automatically move the parent issue to be in done status only if it's not done.

Steps

The following steps demonstrate how to configure Create on Transition's Update issues post function, using the transition feature along with JQL query and regex inspection:

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
idsteps_table
enableSortingfalse
enableHighlightingfalse


Step 1

As a Jira Administrator or Workflow Administrator:

  1. Navigate to your workflow.
  2. Edit your workflow to create a draft version.
  3. Select Done (31) transition
  4. Select the Post Functions tab.
  5. Click Add post function
  6. Select Update issues (Bob Swift) post function and add



Step 2

Within the Issue Fields screen:

  1. Select the Detailed Fields tab.
  2. Select only "Parent issue key" in the Issues to update field
  3. Enter Done in the Transition field.


Step 3

Define the JQL query that needs to be used in conjunction with regex to inspect the number of issues that are not in the Done status.

  1. Select the Conditions & Configuration tab.
  2. Enter "%parent_status%" in the Condition 1 field.
  3. Enter "Done" in the Regular expression pattern field.
  4. Select Negative matching condition, so we only create the sub-tasks update the parent issue when the parent issue's story is not "Done".
  5. Scroll down until you find JQL query field.
  6. Enter "parent = %parent_key% and status != Done" in the JQL query field
  7. Enter "%jql_result_count%" in the Condition 2 field.
  8. Enter "0" in the Regular expression pattern field.
  9. Select Exact matching condition, so we only transition the parent issue to be done when all the subtasks are done.
  10. Click the Add button to save your configuration.


Step 4

  1. Ensure to publish your workflow. It is always recommended to save a backup of the previous workflow when prompted.
  2. Navigate to an issue with sub-task issues that is not done.
  3. Complete all the sub-task issues as done
  4. Validate if the parent issue is also moved to done status.


...