I set up a "send custom email script" post function via script runner and I would like to add the sender's email address in the signature of the email.
the sender refers to a user picker custom field. I created a scripted field to be able to get the email address to display it in the email.
In the scripted field, I wrote the following script :
return issue.getEmailAddress("Change Request Owner Assignee")
I know something's missing but I did not manage to figure out the problem. i tried with String X= fieldX.getEmailAddress but in vain.
Thanks a lot
getEmailAddress wants you to give it a user. You appear to be feeding it a string which looks like the name of a field.
You need to do something more like getEmailAddress($issue.getCustomFieldValue(fieldManager.getCustomFieldByName("CR owner assignee")))
Although there's better ways to do it in a script, this at least shows you why your current code does not work.
In the "CC issue fields" field you can add the id of your user picker custom field, you can find it <baseUrl>/rest/api/2/field, it should be something like customfield_xxxx
(hit preview to make sure that it returns the emails). No need to copy the emails to scripted fields.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough cough, all companies). If content calendars, marketing plans, and bu...
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!
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