Close Parent Issue When All Subtasks Are Done

This is the documentation for JSU for Jira Cloud. If you are using JSU on Jira Server/Data Center, see our JSU Server/Data Center documentation. The Universal Rule Builder is available only in JSU Cloud.


Goal

Eliminate repetitive tasks and save time by automatically closing parent tasks

Scenario

When your team has closed all of an issue’s subtasks, the parent issue remains open and someone has to manually move it to done. Let’s look at how this common task can be automated with JSU’s Universal Rule Builder.

Components

Universal Rule Builder: Related Issue Status and Create a Linked Transition

How to configure this rule

  1. Create a draft of your project workflow. If you're unsure how to get to this page, follow the onboarding steps in Edit a Jira Workflow. You can then view your workflow in Text or Diagram mode. The steps in this use case represent Diagram mode. If you haven't already, switch the workflow viewer to Diagram mode.

    Jira Workflow editor in Diagram mode

     

  2. We want to close parent issues when their subtasks are done, so we need to add the rule for when issues transition to the DONE status. Click the arrow that points to this status to show the transition rule Options menu.

  3. Select Post Functions to display the Post Functions tab.

    Jira Workflow editor in Diagram mode showing post functions highlighted in the transition options menu.

     

  4. Select Add post function to view all available post functions.

  5. Select the Access the Universal Rule Builder from JSU post function, then click Add at the bottom of the page. The Universal Rule Builder displays.

     

  6. We only want the parent to be transitioned to DONE if all of its subtasks are DONE, so we begin by adding a condition. Under All Components, select the Related Issue Status condition.

     

  7. Select All Siblings from the Relation to issue dropdown, then select the done status. The condition displays in the rule overview. Next, we define the action that will occur if this condition is true.

     

  8. Select Add Component in the overview.

  9. Under All Components, select the Trigger a Linked Transition post function.

     

  10. To configure the action:

    1. Select the type of issue you want to move to a new status when the rule is triggered. We want to move the parent issue to done, so we select Parent of the task.

    2. Select the destination status for the issue. Here, we select done from the Status dropdown.

  11. Enter a name for the rule. Choose a name that helps you identify the rule, for example, Move parent to Done.

  12. Select Add at the bottom of the page. A summary of all your post functions applied to this transition is displayed in the draft workflow.

  13. Select Publish Draft at the top of the page. You can choose to save a backup if required before confirming.

Test the post function in the workflow

We recommend that you build and test your rules in a test project.

  1. Go to an open issue that includes one or more open subtasks. If you do not have a test project with the necessary issues, create a task and add a few subtasks.

  2. Transition all of the subtasks to done.

  3. Refresh the browser to reload the parent issue. You'll notice that it has now also been transitioned to done - which means our post function has worked as expected.


    Congratulations! You've just configured your very own automation with the Universal Rule Builder!