How do I display the full name of a user-picker custom field in an email notification?

James Sorby August 1, 2012

Hi,

I have a custom field of type user picker. When I put the following code into an email template:

$issue.getCustomFieldValue("customfield_10094") it simply output the username:1, i.e. "productionmanagertest:1"


If I copy the code for the assignee output in another template, and use

#authorlink2($issue.getCustomFieldValue("customfield_10094") $linkstyle)

then I get nonsense out:

$userformat.formatUser($username, 'profileLinkExternal', 'email', ${velocityhelper.newMap('style', $style)})

How do I code the email template to show the full name of the user selected by the user picker custom field - in this case "Production Manager Test".


Many thanks for any help given,

James.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Pranjal Shukla August 2, 2012

Try this out:

#authorlink($issue.getCustomFieldValue("customfield_10094").name)

James Sorby August 2, 2012

Hi Pranjal,

Thank you very much. That worked perfectly.

Best regards

James.

0 votes
Jobin Kuruvilla [Adaptavist]
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.
August 1, 2012

Is this a username?

productionmanagertest:1

Looks like you have :1 at the end. If you use the macro after removing that extra characters, it should work.

James Sorby August 2, 2012

Hi Jobin,

Thanks for responding. Although not sure I follow. The username for this user is just "productionmanagertest" so I have no idea where the extra :1 is coming from.

Not sure also about what you mean by "If you use the macro ..... it should work.". What macro are you referring to - all I am trying to do here is put some code in the notification email xxxxxx.vm file.

Many thanks

James.

TAGS
AUG Leaders

Atlassian Community Events