Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Close Sub-tasks Before Parent in Jira Automation Rule for a set of user stories?

Vasu Dev August 2, 2025

Hello Friends!

I'm working on an automation rule in Jira (Cloud version) to streamline the process of closing user stories and their sub-tasks. Here's what I'm trying to do:

  • Use JQL to retrieve a set of user stories.

  • Branch into the result and pick the first user story.

  • For that story, close all its sub-tasks first.

  • Once all sub-tasks are closed, close the parent user story.

I understand that a parent story cannot be transitioned to “Done” until all of its sub-tasks are closed.


My current rule retrieves the stories correctly, but I’m unsure how to insert logic that ensures the sub-tasks are closed before attempting to close the parent.

My Questions:

  1. How can I modify my existing rule to close the sub-tasks before transitioning the parent?

  2. Is there a more effective or cleaner way to structure this rule?

Any guidance or examples would be greatly appreciated!

 

This is my current rule:

image.png

I appreciate your help in advance!

Regards,

 

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2025

Hi @Vasu Dev 

First thing: what problem are you trying to solve?  That is, "why do this?"

Knowing this will help the community offer better suggestions, or perhaps other alternatives, because you seem to be describing this:

GIVEN several Story work items
AND each Story has Subtasks
WHEN a rule is manually triggered
THEN for-each Story
  Transition the Subtasks to "closed"
  AND then transition the Story to "closed"

This type of bulk-closing seems to remove the value of having the Subtasks: if they are just going to be closed why not just have the Story instead?

 

Assuming there is a reason to do this type of bulk-closing...

  • Consider not doing it.  Instead, ask your team to update the Subtasks when completed, and then use a different rule to close the Story when all Subtasks are closed.  There is a template in the rule list for that case.
  • If the bulk-transition is a one-time need, I recommend using a series of JQL filters and bulk-edits for the changes
  • If this is an ongoing need, automation rules cannot nest branches.  To bulk-transition the subtasks within the branch to the Story work items, one could call a REST API endpoint for bulk-transition using the Send Web Request action.

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events