Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to Prevent Close of Epic Until All of its Issues are Closed

The OOTB template for Software projects allows an Epic to be closed even though there are Issues in the Epic that are not closed.
I want to prevent the closing of an Epic unless all of it's Issues are closed.
There is a "Sub-Task blocking condition" for the Done status has but that doesn't work for Epics.

2 answers

1 accepted

1 vote
Answer accepted
Tessa Tuteleers Community Leader Jun 08, 2018

Hi Diane, 


You are correct, OOTB, no such condition is included. 

But this is a popular use-case and while the problem can be resolved through business rules and training of the users, sometimes a firmer restriction is wanted. 

There are a few possibilities with apps however:

  • JMWE has this option in the UI. It's a neat tool with a low threshold for a lot of extra workflow possibilities.

Screen Shot 2018-06-08 at 16.06.24.png

  • However, if you have ScriptRunner on your instance (as every instance should), and you have someone to script it, that app makes this possible too and gives you even more functionality! 

Hope this helps! 

- Tessa

Hi Tessa,

What would the coding in Scriptrunner be if I don't have the JMWE add-on available? Could you help me with this one? Requirement: "Close epic only possible when all stories and bugs related are closed". And I would add that coding than as a post-function "Script validator"? 

Thank you for your help. 

Like Renni Verho likes this

Something like this may help : 

import com.atlassian.jira.component.ComponentAccessor

// Allow logging for debug and tracking purposes
import org.apache.log4j.Level
import org.apache.log4j.Logger

// Script code for easy log identification
String scriptCode = "Check all items resolved -"

// Setup the log and leave a message to show what we're doing
Logger logger = log
//logger.setLevel( Level.ERROR )
logger.setLevel( Level.ALL )
logger.debug( "$scriptCode Triggered by $issue.key" )

passesCondition = true
if ( == 'Epic')
IssueLinkManager issueLinkManager = ComponentAccessor.issueLinkManager
def found = issueLinkManager.getOutwardLinks({
it?.destinationObject?.getResolution() == null
if (found){
logger.debug( "GetResolution empty found" )
passesCondition = false
} else {
logger.debug( "GetResolution no empty found" )
passesCondition = true
// Always allow all other issue types to execute this transition
logger.debug( "$scriptCode Not Epic return true" )
passesCondition = true

I would add here also link type verification eg. check only "Issues in Epic", but not all linked issues.

Hello, I am looking for the same functionality in the Jira Cloud next-gen software project. Can anyone help? Thank you

Like Ivo de Vries likes this

You can use the Jira Misc Workflow Extensions add-on.  This will allow you to add a validator to the workflow transition, checking the status of Stories within an Epic.

In the Software Basic project type there are no stories.  There are Epics, New Features, Improvements, Bugs, Tasks and Sub-Tasks.  No parent-child links at all except between Tasks and Sub-Tasks and sort of with Epics and all other issue types except sub-tasks.  The team I'm setting this up for does not really want stories or features, they just want tasks and sub-tasks and would like a parent of Tasks in some way. I see with the Basic Software project I can sort of create a parent of Tasks through Epics. So will the validator work between Epics and its Issues of any type?

Yes it should.  You can link Tasks to Epics in the same way you would with Stories.  Make sure the Task create/edit/view screens all have Epic Link as a field.

how to check the stories in epic.. 
I'm seeing under validator called Linked Status (JSU).. But I'm not able to find the right option for the below collumn

  • Issues which are linked as : 

@Amarendar Musham if you have JSU, use a JQL Condition (rather than a validator), it achieves a similar goal but doesn't show the transition button or allow the drag on the Kanban view.


You need to configure a JQL statement that checks that all child issues are done, for example:

  • JQL Expression: issue in childIssuesOf({issue.key}) and status != Done
  • Number of Issues found: Must not find issues
Like Sima likes this

@Nigel BuddThank you very much for this easy solution using JSU - it worked perfectly for me with your instructions. You really helped me out here and saved me time!

Is there a comparable solution for Jira Cloud and, more specifically, for the Jira Next-Gen projects?

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you