Automation For Jira - How to write a rule to close a parent issue after all sub-tasks have been closed

Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When a parent issue (for example Task/Bug/Story type issue...) has sub-tasks underneath it, we might want to automatically close it once all the sub-tasks have been closed.

The purpose of this article is to provide a way to configure an automation rule that will automatically close the parent issue, once the last sub-task was closed.

Solution

Keep in mind

  • The rule must be scoped to the project that contains the parent and sub-task issues. If the rule is configured as a global rule, confirm the project is not excluded.

  • The parent issue's workflow must permit the transition to the destination status attempted by the rule. If the workflow does not allow that transition from the parent's current status, the rule will fail silently — check the audit log for a "transition not available" error.

  • This article covers only the Data Center automation syntax. The Cloud equivalent uses different components and smart values — don't apply these steps on a Cloud site.

Automation rule configuration

  • Add an Issue Transitioned trigger with the parameters below:

    • From Status: leave empty

    • To Status: choose the workflow status that issues enter when they are closed/done. For example: the status DONE

  • Add an Issue Field Condition with the parameters below:

    • Field: Issue Type

    • Condition: Equals

    • Value: Sub-task

  • Add a Branch Rule with the parameter below:

    • Type of related Issues: Parent

  • Inside the Branch Rule, add the 2 components below:

    • Add a Related Issues Condition with the parameters below:

      • Related Issues: Sub-tasks

      • Condition: "All match specified JQL"

      • Matching JQL: "status = DONE"

        • Make sure to change the status to the one used in the workflow when an issue is closed (for example: Closed, Resolved, etc...)

    • Add a Transition Issue action with the parameters below:

      • Transition the issue by: "Selecting the destination status"

      • Destination status: DONE

        • Make sure to change the status to the one used in the workflow when an issue is closed (for example: Closed, Resolved, etc...)

Screenshot of the automation rule

Automation rule screenshot

Confirm if the rule works

  1. Choose a parent issue that has more than one sub-task.

  2. Close every sub-task except one.

  3. Close the last remaining sub-task (transition it to the status you configured in the trigger's To Status field).

  4. Open the parent issue and confirm it has transitioned to the destination status you set in the Transition Issue action (for example, Done).

If the parent does not transition:

  • Open Project settings > Automation > Rule details and check the Audit log for the rule.

  • The most common cause is the trigger's To Status not matching the exact status the sub-task enters when it is closed. Verify the status name in the trigger matches the workflow status used by your sub-tasks.

Updated on July 6, 2026

Still need help?

The Atlassian Community is here for you.