scriptrunner send notification if the value of custom field change

I need to fire a notification if the value of custom field changes.  I don't have a preference if it is a listener or post condition from the workflow.

Custom Field: Team - cf [10108].

Currently notifications are being sent with the default "issue update" which has generated too many notifications.

1 answer

Have you tried adding this condition to 'Fires event when condition is true' :

def condition = changeItems.any{it.field == "Name of Custom Field"}
return condition

i've tried something similar:

Thanks for your help.  I am new to this.  I receive this error. 
No such property: changeItems for class: Script1

I was trying:

def change = changeItems.find {it.field == "Team"}
if (change) {
def oldValue = change.oldstring
def newValue = change.newstring

Is this in a script file or have you pasted it into the inline editor? 

inline editor. from script console and script listeners

changeItems won't be defined in the Script Console; it's only defined in the context of Script Listeners, specifically in the condition field. Do you really get an error there? If so, what version of ScriptRunner are you on, and can you provide a screenshot? I'm not seeing that in my instance.

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,345 views 14 20
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