I am trying to dynamically set the recipient addresses based on the settings of a custom field ('Notification List', checkbox collection contains a list of department)
In the condition & configuration section, I have a
if ('Engineering' in cfValues['Notification List']*.value) {
recipients = recipients + ",addr1@host.com"
}
if ('Purchasing' in cfValues['Notification List']*.value) {
recipients = recipients + ",addr2@host.com"
}
mail.setTo(recipients)So far so good, and working as expected
However, I'd like to pull from another custom field (ProjMgr) for one of the conditions
if ('Project Management' in cfValues['Notification List']*.value) {
pm = com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("ProjMgr")
pmValue = issue.getCustomFieldValue(pm)
recipients = recipients + "," + pmValue
}ProjMgr is User Picker type. In this case, I got the user id in pmvalue. How can I find the user's email address to construct the recipients list?