Dear @Alexey Matveev
How are you? Hope you are doing great. Is there a way to write a scripted condition to add as a transition condition to allow only if all the task and sub-tasks are closed in an epic in a workflow.
Please let me get some help you. As always many thanks.
IssueLinkManager issueLinkManager = ComponentAccessor.issueLinkManager
def found = issueLinkManager.getOutwardLinks(issue.id).any
{
it?.destinationObject?.getStatus().getName() != "Closed" &&
it?.destinationObject?.getIssueType().getName() == 'Story'
}
Hello @Marija Ušakova,
I am doing great. I hope you are doing great too. Here is the condition:
import com.atlassian.jira.component.ComponentAccessor
passesCondition = true
def issueLinkManager = ComponentAccessor.issueLinkManager
issueLinkManager.getOutwardLinks(issue.id).each{ issuelink ->
if (issuelink?.destinationObject?.getStatus().getName() != "Closed" && issuelink?.destinationObject?.getIssueType().getName() == 'Story') {
passesCondition = false
}
if (issuelink?.destinationObject?.getIssueType().getName() == 'Story') {
issuelink?.destinationObject?.getSubTaskObjects().each{subtask ->
if (subtask?.getStatus().getName() != "Closed") {
passesCondition = false
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.