Epic cannot be closed if Story is 'In Progress'

Hello,

I need to find a way to restrict the EPIC from showing the Close transition if the stories in the Epic are in Open or In progress state.

I only have the script runner plugin.

The solution here: http://www.adaptavist.com/w/jira-genius-ensuring-that-epics-are-only-closed-when-stories-are-complete/

Doesn't work as it involves JMWE as well.

 

Thanks a mill.

 

1 answer

1 accepted

Hi miller,

You can have a Simple Scripted Condition with the following script 

import com.atlassian.jira.component.ComponentAccessor

final def LINK_TYPE = "Epic-Story Link"
final def COMPLETE = "Complete"

ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.id)?.findResults {
it.issueLinkType.name == LINK_TYPE ? it.destinationObject : null
}?.findAll { it.status.statusCategory.name != COMPLETE }?.size() == 0

Hope that helps, Thanos

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

675 views 4 15
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot