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?

Thanks


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




EDIT:

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

2 votes

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 

cfValues["reviewer"]

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 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,128 views 13 19
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