GroovyScript - Multi Conditional Script Listener

We have a script listener that looks for a P1 ticket, and then email's us a standard email to let us know that it was been raised and the condition we use is;

cfValues['IS Priority']*.value.contains("P1")

How can I add an extra condition to this? I would like to add an extra condition that if it is a P1 and "Custom Field = Value" then send us an email. Is is possible to add two fields into a groovy condition?

2 answers

1 accepted

1 vote
Accepted answer

did you tried like this?

cfValues['IS Priority']*.value.contains("P1") && cfValues['customfield Name'] == "Value"

or 

cfValues['IS Priority']*.value.contains("P1") && cfValues['customfield Name'].value == "Value"

hello Ashley Powell,

check this once https://answers.atlassian.com/questions/171513/syntax-for-multiple-conditions-and-additional-actions-in-script-clones-an-issue-and-links

and

https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-ConditionTester

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,958 views 19 22
Read article

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