Script runner - fire an event if condition is true


I have installed Script Runner and I would like to fire an event if the following condition is true,

custom field value is equal to: The field is blank but how how do I specify this in the condition i.e.

cfValues['Region'] == 'EMPTY'

cfValues['Region'] == 'NULL'

cfValues['Region'] == '0'

None seem to work, I must have this working for when the region field is blank


4 answers

0 vote

Like this:

! cfValues['Region']

Hi, I have the same requirement. So, I used 'Fires an event when condition is true' built-in script in my post function when issue gets created.

I'm using the condition '['Sev1', 'Sev2'].contains(cfValues['CS Priority']?.getValue())' where CS Priority = our custom priority field, which returns true if either Sev1 or Sev2 issue is logged.

However, in my jira logs (debug turned ON), I noticed

/secure/QuickCreateIssue.jspa [groovy.canned.utils.ConditionUtils] Condition: issue.priority?.name == 'Major' returned: false

Why isn't the Script Runner using my condition ? Any help will be great. Thanks.

How would you write a condition for priority to be for instance a 'P1'

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

173 views 0 4
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