Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I get email address of user custom field in behaviours

Can I get email address of user custom field in behaviours?

I have a customfield -type- user.

Is there a function that, using behavior, pull out the email of the entered field on the portal

1 answer

you get the string value of the field in the behaviours, so you need to use userManager to get ApplicationUser object and retrieve email from it :

import com.atlassian.jira.component.ComponentAccessor
def field = getFieldById(getFieldChanged())
def userName = field.value
def email = ComponentAccessor.userManager.getUserByKey(userName)?.emailAddress

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

How to simplify creating release notes from Jira!

...igure out how fast you can release, so that you stay true to your development plan and the needs of your customers. In this article, we will introduce a few practical ways of documenting your release n...

27 views 0 0
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you