Hello,
I need a solution which blocks transition "Done and "Closed" when issues has specific value in field and is linked to specific issue type.
In other words: should not be possible to move Story to "Done" and "Closed"
IF Risk = High and Severity = Extensive and issue is linked to Change request.
Is it possible to do that with the script runner?
Any examples of the code?
Thank you :)
Sure it's possible.
But you probably need 2 workflow validators. One for each transition (to done and to closed). You can use a single script file and link it from both transitions.
So in each of those transitions, add a validator and select "Simple Scripted Validator" then either paste or point to file with
def isHigh = cfValues['Risk']?.value == 'High'
def isExtensive = cfValues['Severity']?.value == 'Extensive'
def isLinkedToRFC = issueLinkManager.getLinkCollectionOverrideSecurity(issue).allIssues.any{
it.issueType.name=="Change request"
}
!(isHigh && isExtensive && isLinkedToRFC)
Then add the message you wish to display when all 3 are true
Hello,
Perfect!!!
I modified it, since we have two Risk fields, so I added additional lines.
You helped me a lot, it works, thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.