Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Block transitions

Jovita Sajonaitė May 29, 2020

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 :)

2 answers

1 accepted

0 votes
Answer accepted
PD Sheehan
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.
June 1, 2020

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 

0 votes
Jovita Sajonaitė June 1, 2020

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!

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events