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

This widget could not be displayed.

Hi Baris

Something like this is working for me, try:

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

regards,

Paweł

This widget could not be displayed.

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 Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

33 views 0 1
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