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

Tatiana Jancusova June 22, 2014

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?

2 answers

1 accepted

3 votes
Answer accepted
Vijay Khacharia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2014

Hi,

Try this out.

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

Vijay

Tatiana Jancusova June 22, 2014

Thank you, full name works perfectly!

Do you know, why I get the username twice?

Vijay Khacharia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2014

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

Tatiana Jancusova June 22, 2014

Right method for user name:

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

Kapil Agarwal September 10, 2015

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

Like Graham Twine _Slm_ likes this
0 votes
hemalathacg March 29, 2019

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

Kindly reply

Suggest an answer

Log in or Sign up to answer