ScriptRunner - create email for custom field

Hi all

I've got script runner installed and have a custom field called reviewer. When reviewer is set then I would like an email sent to that person (much like what is sent if you are assigned a JIRA)

The reviewer field is of type "User Picker (single user)"

Is it possible to send an email to this selected person. At the moment i can easily see how to map the user to the user's email address on their profile? Is this possible?


image2015-7-27 17:22:59.png


Thanks to @Jamie Echlin [Adaptavist] for the help so far. I still dont get any emails though. See my configuration

image2015-7-28 21:52:22.png

2 answers

You should be able to use the custom field ID, as it says in the text underneath the field.

So eg: customfield_10020 should work fine.

But your condition is wrong, try 


Note that case is important, so check if it's Reviewer or review... also you have typo'd the field name. 

Thanks Jamie Echlin How do I get the customer field id. From the URL I can see things like customFieldId=10311 so i used customField_10311 (removing the = and the Id) For the condition I can search within JIRA with just the Reviewer field but I see from your example I have to use cfValues[....]. Im using "cfValues['Reviewer'] is not null" which hopefully will work Thanks for your help!

thanks @Anton Haglund . The id field I found was the correct one

Hi @Jamie Echlin [Adaptavist] . I tried cfValues['Reviewer'] is not null and various other combinations but none worked. Is there some other trick I need here? Thanks

for the "to issue fields" use: customfield_12345 be careful of the case, earlier you wrote customField. Try that without a condition, if that works we can work on the condition.

Thanks @Jamie Echlin [Adaptavist] I did have the wrong case but still dont get the emails :(. I have updated the question with a screenshot. Ive tried to put in my email address directly but still dont see it. Also is there a away to put the link to the JIRA in the email subject or mesage?

I have a similar workflow but I took a low-tech approach. I added a transition to all the relevant steps called "Add <role>" and created an event called "<role> assigned" that I added to my notification scheme. I also removed the <role> field from the edit issue screen to the transition is the only way to get to it. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,476 views 15 19
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