The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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
Hi @Shah Baloch
How do you plan to implement that using a post-function or a listener to trigger at the create issue event?
Cheers
Alex
I would like to have it in the initial stage like when the issue is created it should have the email address in the email field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to make it works with a behaviour script by mapping manually users' names with their emails. The problem is someone needs to maintain the script when there will addition and deletion of a user. I mean have to maintain the script when need to remove or add a member. I was looking if there will be an easy way to not maintain the script all the time?
def optionsConMap = [
'User Name': 'user@email.com',
'Some User': 'some@email.com'
]
def option = getFieldById('customfield_10519').value
def emailAddr = optionsConMap[option]
getFieldById('customfield_10520').setFormValue(emailAddr)
def email = getFieldById('customfield_10520')
email.setHidden(true)
Thank you for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.