Scriptrunner listener updated field value is not available to downstream event listener

I have created two ScriptRunner listeners

1) Fire an event when condition is true: Under some conditions, sets a custom field to an email address or two comma-separated email addresses. Fires a custom event.

2) Send a custom email: Listens for the custom event and sends an email via the "To issue fields", to customfield_NNNN (the custom field id)

The email address field is always set appropriately, but sometimes the To address in the email is empty. That must mean the Send a custom email listener does not get the new value for the customfield_NNNN field. 

Is there some timing window I should be aware of and a way to avoid it?

1 answer

Just a thought: it may be easier to do this all in one listener. You can dynamically control the list of recipients from your listener's condition code. That might remove the need for one listener to update a custom field (which you may not need) and another to fire the email.

Can you provide the code for the first listener that both sets a custom field and fires an event?

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

181 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