How to display user ID and full name of user picker?

I would like to display username and full name of an user picker field in Built-In Scripts custom email. If I use:

<% out << issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("Team Lead")) %>

I get username twice: username(username)

Also I would like to display the full name of the user in my custom user picker field.

Any suggestions?

1 answer

1 accepted

2 votes
Accepted answer

Hi,

Try this out.

<% out << issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("Team Lead")).getDisplayName() %>

Vijay

Thank you, full name works perfectly!

Do you know, why I get the username twice?

I am not sure why it writes two times the name. I think its the user_name (user_name_lower)

Right method for user name:

<% out << issue.getCustomFieldValue(componentManager.getCustomFieldManager().getCustomFieldObjectByName("Name")).getName() %>

Where we need to write this code to get full name in the field

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

886 views 3 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you