Can I use originalIssue with cfValues in Builtin Script Listener Conditions ?

Hi there,

Hopefully this makes sense and it is not a stupid question. I am trying to check if a custom field value has changed to one of valid values and fire an email if so.

I have created a Builtin Script Listener with the condition:

cfValues['Documentation Status'] != 'None Required' && cfValues['Documentation Status'] != null

which works pretty good but the problem is that it fires the email at every update as long as the above condition is met not checking if the value has changed at all. And I don't want to fire an email if the value has not changed from the original value.

So something like the below would be nice :)

cfValues['Documentation Status'] != 'None Required' && cfValues['Documentation Status'] != null

&& cfValues['Documentation Status'] != originalIssue.cfValues['Documentation Status']

And naturaly that doesn't work :)

Any ideas ?

Cheers,

Baris

2 answers

Hi Baris

Something like this is working for me, try:

&& changeItems.any {it.get('field')=='Documentation Status'}

regards,

Paweł

def field = event.getChangeLog().getRelated('ChildChangeItem').any{ it.field.toString().equalsIgnoreCase("Documentation Status")}

if (field){

}

this will return bool value

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 ...

3,076 views 13 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