I want to add a Jira user's email to a custom field base on the selection of the user's display name from a custom drop-down field. There is a custom drop-down field "Contact Person" which has about 8 to 10 users. The name is the same as the Jira display name, but we added a custom field that users only can select those users.
The use case is that once the user selects a user (John Doe) from the dropdown field, it should add that user's email into a custom email field. I'll hide the email field from creating screen and it'll be only in the view screen. How can I achieve that?
def conPerson= getFieldById('customfield_10519')
def emailAddr= getFieldById('customfield_10520')
if(conPerson.value == 'John Doe') {
set emailAddr value to user's email
}
Thank you for your help