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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,711 views 17 21
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