Transition a linked issue using Groovy expression

Hello

 

I have zero experience in groovy expressions and I am trying to use JIRA Misc Workflow extensions to transition a linked issue based on a certain condition. I would like to ensure this post function cannot be completed unless a custom field has a certain value in it. 

 

I have tried:

if(issue.get("customfield_10900") =  2) {
return true;
} else {
return false;
}

 

and I get the error message - 

startup failed: Script1.groovy: 1: expecting ')', found '=' @ line 1, column 35. if(issue.get("customfield_10900") = 2) { ^ 1 error

It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your JIRA administrators.

 

If I change it to:

if(issue.get("customfield_10900") >=  2) {
return true;
} else {
return false;
}

I do not get an error message, the linked issue will transition but it ignores the condition (for instance my custom field could say 0 or 1 instead of 2)
Hopefully someone can help. 
Thanks

1 answer

It may be worth mentioning that the Custom Field is a number field, I am unsure if that makes much difference. 

 

Thanks

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,950 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot