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

Baris Guner October 15, 2013

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

0 votes
Paresh Gandhi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

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

if (field){

}

this will return bool value

0 votes
PawełM March 18, 2014

Hi Baris

Something like this is working for me, try:

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

regards,

Paweł

Suggest an answer

Log in or Sign up to answer