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
Community moderators have prevented the ability to post new answers.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.