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:
How can I modify my existing rule to close the sub-tasks before transitioning the parent?
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:

I appreciate your help in advance!
Regards,