Forums

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

How to prevent epic from closing when the child tasks are not closed?

Hema April 15, 2021

Currently I found a way in the forum to prevent closing of epic if stories linked to it aren't closed. I'm trying to achieve the same but "Task" instead of stories linked to an epic must close for the epic to transit to closed status, using script runner.

Answers are welcome, even If it's possible using automation for JIRA.

1 answer

1 accepted

3 votes
Answer accepted
Walter Buggenhout
Community Champion
April 15, 2021

Hi @Hema,

You probably refer to the solution described in e.g. this related question, where issues.stories.length is uses to check for open issues in the epic.

It also mentions that issues.stories refers to all issues at the level below an Epic:

// The stories paramater returns all the issues below the Epic issue to allow there status to be checked. 

In other words, this already includes tasks by default and probably covers your use case where you don't want to close an Epic if any open issues are still in it.

Should you specifically want to only check on tasks, you should be able to add an additional condition along these lines:

issue.issueType.name.match('^(Task)$')

For more information, have a look at some code snippets over here

Hema April 15, 2021

Thanks @Walter Buggenhout .

Like John Funk likes this
Fiamma Quispe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 14, 2023

Hello @Hema @Walter Buggenhout ,

How did you resolve this Jira expression?

My scenario is similar: I have an Epic that can have 04 types of child issues: Story, Task, Bug and Artifact.

I'm trying to create an expression in Epic's "Done" transition that checks if all my child issues are completed, if yes, it lets follow, if not, returns error.

 

Thanks. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events