Automatically close Jira work item when all other linked work is closed
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Jira automation can help reduce tedious work to mitigate risk and improve efficiencies in your projects.
Let's say we have a work item, ITSM-100, with linked work items ITSM-101 and ITSM-102. We want ITSM-100 to close automatically only when both ITSM-101 and ITSM-102 are closed.
Solution
Step 1: Set up the Automation rule with a trigger
Navigate to your project, select Project Settings > Automation > Create rule
Select the Issue transitioned trigger and set the destination status that matches your workflow
In our example, we choose the Resolved status
This trigger ensures that the rule activates whenever a linked work item transitions to the "Resolved" status.
The following steps will evaluate if all linked issues are Resolved.
Step 2: Create a branch rule for linked issues
In the automation rule editor, select Branch rule / related work items and choose Linked work items
Specify the link types if required
This step will allow actions to be performed on the main work item (e.g., ITSM-100) that is linked to the work items transitioning to Resolved (e.g., ITSM-101 or ITSM-102)
Step 3: Use a Lookup work items action
Add a Lookup work items action using the following JQL query:
issue IN linkedIssues("{{issue.key}}") and status != Resolved
This JQL query checks if there are any linked work items to the main issue that are not yet resolved. You can adjust the JQL to fit your specific requirements.
Step 4: Add a Conditional check
Check the results from the 'Lookup work items' action:
Use a condition to verify if
{{lookupIssues.size}}
equals 0.
If all linked work items are resolved, the JQL query will not return any results, making {{lookupIssues.size}}
equal to 0. This condition allows the rule to proceed to the next step to close the main work item.
Step 5: Transition the main work item
Transition the main work item (e.g., ITSM-100) to "Resolved":
This action is executed only if the condition from Step 4 is met (i.e., all linked work items are resolved)
Please refer to the below screenshot for an example of our automation rule thus far.

If the JQL query does return any unresolved work, {{lookupIssues.size}}
will not be 0, and the condition will fail. This stops the transition of the main work item to "Resolved."
Additional Options
Add more conditions or actions: You can include additional checks, such as verifying the Request type or setting the Resolution field, to tailor the rule to your specific requirements.
By following these steps, you can automate the process of closing a primary issue when all its linked issues are resolved, improving efficiency and ensuring consistency in your issue management process.
Was this helpful?