Transition Epic only when stories are in certain state

Mark Beierl May 1, 2014

Is it possible to write a codition that prevents an epic from changing states if the linked stories are not in the right state? Epics do not have parent/child relationship from what I can tell.

2 answers

1 accepted

0 votes
Answer accepted
Mark Beierl May 1, 2014

If I use the following as a condition on the Done transition for the Epic, it works:

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import org.apache.log4j.Category
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink;

passesCondition = true

linkMgr = ComponentManager.getInstance().getIssueLinkManager()
for (IssueLink link in linkMgr.getOutwardLinks(issue.id)) {

    if (link.issueLinkType.name.equals("Epic-Story Link")) {
        if (! link.getDestinationObject().getStatusObject().getStatusCategory().key.equals("done")) {
            passesCondition = false
        }
    }
}

return passesCondition

0 votes
David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2014

This is not currently possible with JMWE 3.3.0, but it would certainly be an interesting enhancement. If you are interested, can you please create a Enhancement Request on our issue tracker at https://innovalog.atlassian.net/browse/JMWE

Please specify your use case in as much details as possible. In particular, please specify whether you're interested in a Condition, which will simply hide the transition when the condition is not met, or a Validator, which will allow the transition to begin but will display an error message after you hit the submit button.

Mark Beierl May 1, 2014

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events