Getting User from User Picker, Jira 5.0.7?

Hallo,
I want to get value (user) of User Picker.
I'm using this script:

#set($StaffInvolvedField = $customFieldManager.getCustomFieldObject("customfield_10500"))
#set($StaffInvolvedValue = $issue.getCustomFieldValue($StaffInvolvedField))

This script gives me as result, com.atlassian.crowd.embedded.ofbiz.OfBizUser@391b8e5

I have already tried getdisplayName, displayName or Name methots but it did not work.

Version of Jira is 5.0.7

1 answer

some utility code for diffrent fields, check this

#set( $issueCustomField = $issue.getCustomField( $customFieldKey ) )
#if ($issueCustomField)
#set( $issueFieldValue = $issue.getCustomFieldValue( $issueCustomField ) )
#if ($issueFieldValue)
$stringUtils.leftPad($issueCustomField.name, $padSize): #if ($customFieldType == "select")
$issueFieldValue.value
#elseif ($customFieldType == "multiselect")
#foreach ($entry in $issueFieldValue)$entry.value#if ($velocityCount != $issueFieldValue.size()), #end#end
 
#elseif ($customFieldType == "version")
#foreach ($entry in $issueFieldValue)
$entry.getString("name")#if ($velocityCount != $issueFieldValue.size()), #end
#end
 
#elseif ($customFieldType == "user")
$issueFieldValue.displayName
#elseif ($customFieldType == "multiuser")
#foreach ($entry in $issueFieldValue)$entry.displayName#if ($velocityCount != $issueFieldValue.size()), #end#end
 
#elseif ($customFieldType == "datetime")
$dateformatter.formatDMYHMS($issueFieldValue)
#elseif ($customFieldType == "date")
$dateformatter.formatDMY($issueFieldValue)
#else
$issueFieldValue
#end
#end
#end

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

57 views 0 5
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