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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,811 views 11 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot