Forums

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

How can i set a condition that user cannot close the issue until all the child issues are closed

Sunilkumar k
Contributor
August 3, 2023

Hi,

 

I need to restrict the user to not close the parent issue until all it's child issues are closed.

how can i achieve this without using any add on ?

 

Thanks in advance !

 

 

 

 

 

1 answer

1 vote
Trudy Claspill
Community Champion
August 3, 2023

Hello @Sunilkumar k 

Are you talking about Epics and their child issues, or standard issues and their child subtasks?

Are you working with issues in a Team Managed project or a Company Managed project? You can find that categorization of the project in the Type column on the View all projects screen.

For Company Managed projects there is a native option in the Workflow to set a Condition to block closure of a parent issue if it has open Sub-tasks. There is not an equivalent native feature for blocking closure of an Epic that has open child issues. To create that type of block with only native functionality you could use a custom field to keep track of whether or not the Epic has open child issues, using an Automation Rule to update the field. Then you use the Workflow Transition Condition "Value Field" to confirm that field has a value that indicates there are no open child issues for the Epic.

For Team Managed projects there is no native rule to block closure of either a standard issue based on open subtasks or an Epic issue based on open child issues. You might be able to use the same custom field/automation rule work around mentioned above, and use the Restrict to when an issue has a value rule in the workflow to prevent the transition.

Sunilkumar k
Contributor
August 15, 2023

Hi @Trudy Claspill  I have created the automation rule , that triggers while the transition of in progress  to done of the epic, and checks that whether all the child issues of the epic are closed and i used the custom field to track whether the epic have open child issues, then i used Workflow Transition Condition "Value Field" to confirm that field has a value that indicates there are no open child issues for the Epic.

 

But when I am trying this ,  the condition is getting executed before the automation is getting executed so that it is not working properly,

I am trying this in the company managed project , can you please suggest me if there is any other procedure.

Trudy Claspill
Community Champion
August 16, 2023

Hello @Sunilkumar k 

A rule that uses the Issue Transitioned trigger will be triggered after the issue transitions completes. Conditions, Validators, and Post Functions in the transition will all be executed before the rule is triggered.

Your automation rule needs to be designed to trigger when the child issues transition, not the Epic. From the transitioning of a child issue you then need to check if its parent Epic has open child issues and update the custom field in the parent Epic accordingly.

Trigger: Issue Transitioned
Condition: Issue Type is not one of: Epic, Sub-task
For: Related Issues: Epic (parent)
Action: Lookup Issues
JQL: "Epic Link" = {{issue.key}} and statusCategory != Done
If/Else: Advanced Compare: {{lookupIssues.size}} > 0
Action: Edit Issue
set custom field to the value that indicates child issues are not all closed
Else:
Action: Edit Issue
set custom field to the value that indicates child issues are all closed

Suggest an answer

Log in or Sign up to answer