groovy script workflow condition for project ID in Jira

Hi, I need to make a condition in Jira workflow so that a transition is allowed only if a jira ticket is in a particular project, the project key would be ES

I am trying to do this with groovy but cannot get it going.

Any help would be graetly apreciated.

3 answers

1 accepted

This widget could not be displayed.

Here's the code:

issue.getProjectObject().getKey() == 'ES'

Its not working for me. I am trying to in POST function to Set Field Value to constant value with Conditional execution. code is : if(issue.get("projectKey")=="BO") return true; } else { return false; } Please help to solve this problem.

Also tried : if(issue.getProjectObject().getKey() == 'BO') return true; } else { return false; }

This widget could not be displayed.

Hi, thanks, I tried that and got te error below

Errors

  • NoViableAltException(8@[478:1: operator returns [Operator operator] : ( EQUALS | NOT_EQUALS | LIKE | NOT_LIKE | LT | GT | LTEQ | GTEQ | IN | IS NOT | IS | NOT IN | WAS | WAS NOT | WAS IN | WAS NOT IN | CHANGED );])

Script workflow function : The action will be allowed if the issue matches the JQL query: "issue.getProjectObject().getKey() == 'ES'"

It seems you're using the wrong condition. You should use simple scripted condition.

This widget could not be displayed.

Hi Boris, thank you so much, it works great. Lucky to have people like you around

David M

Can someone post what the final script would look like then?  Sorry, I didn't follow the "simple scripted condition" fix.  Thanks.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

124 views 2 0
Join discussion

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