How to block Epic Status based upon the Stories Status

Hi 

I want to block Epic Status based upon the task Status, like the way we have subtask blocking condition for task. in Script runner plugin.

 

Could anyone help.

 

Regards,

Sajid

 

2 answers

1 accepted

You can use the same conditions as the one for subtasks:

https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/conditions/all-dependent-issues-resolved.html

Write a scripted condition similar to the one below:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink

linkType = ["Epic-Story Link"]

linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getInwardLinks(issue.id)) {
    if (linkType.contains(link.issueLinkType.name)) {
        if (link.sourceObject.status.name != "Done") {
            passesCondition = false
        }
    }

}

Hi Syed,

Can you please post the correct code! I was trying to achieve this but it's not working 

 

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 ...

398 views 1 13
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