Keep your backlog clean by ensuring parent issues are automatically closed when all of its sub-tasks are completed
↓ Follow the visual step-by-step guide below to see how to configure this automation in your Jira instance. ↓
If you haven't already, switch the workflow viewer into "Diagram Mode"
As we want to close parent issues when its' sub-tasks are done, we need to add the rule specifically to when issues transition to the status. Click on the arrow that points inwards to this status to show the transition rule menu.
As we want to add a Post-Function to this transition, which runs an automation after the issue has been transitioned to the target status. Select "Post Functions" from the list which opens a new tab.
In the Post Functions table - click "Add post function" to view all available post-functions.
Choose "Linked Transition (JSU)" and then click "Add" at the bottom of the screen.
As we want the parent to be automatically closed when the last sub-task is Closed - let's set "Trigger transition on all issues related as" to "Parent / Sub-Task > Parent (Issue in Transition must be Sub-Task)".
Now, we have to tell JSU which transition and in which workflow do we want to transition the Parent issue we just selected. As we want to keep this rule simple, we only want this rule to apply to issues in our "JSU" project. So for "Transition" we select the workflow that applies to our JSU project and the "Done" transition. This means any parent issues will be transitioned to as part of the rule we're configuring.
But remember, we only want the parent to be transitioned to if ALL of it's sub-tasks are also . To configure this, for "All other sibling issues (for example linking to the target with the same link type) must have one of the following statuses" we're going to set this as "Done".
The remaining fields are optional. For your reference though we can talk about how you might want to use the remaining fields. If you're happy as is, feel free to proceed to Step #9.
Resolution - If you would like to add a Resolution to the parent issue after the post-function closes it, you can define which Resolution to choose in this field.
Perform as user - In Jira Cloud, all "actions" both manual and automated, must be performed by a registered Atlassian account. If you'd like JSU to impersonate another user to run its automation, you can choose that user here. It's important to note that the impersonated user must have the right account privileges to perform the action. If you're not sure, just leave this field blank. Leaving the field blank means the automation will be ran as the "JSU add-on user" which has elevated privileges and can perform most functions.
Copy field - If you'd like to add more information to the parent issue as part of the automation, you can describe what information you'd like to add here.
Now you're ready to save your new Post-Function. To do this, click "Add" at the bottom of the page.
You can now see a preview summary of all your Post-Functions applied to this transition. To confirm this new workflow and test it out, you need to publish it. At the top of the screen click "Publish Draft" and then either "Yes" or "No" if you'd like to save a backup of the workflow before our changes are applied, followed by "Publish" again.
Now we can go test the post-function in action! Head to an open issue that has one or more open sub-tasks within it.
Now proceed to transition all of the subtasks to .
Now refresh/reload the parent issue. You'll notice that it has now also been transitioned to - which means our Post-Function has worked as expected!
Congratulations! You've just configured your very own automation!
Feel free to continue exploring other use-cases for this Post-Function, such as "Close parent Epic when all the issues within the Epic are done" and more!