how to get user full name who ever transitioned the jira issue


we are using below script to get the Rejecter user id when the issue moved to Rejected state but we require the full name in custom filed. plz some one help me to get the user full from the statement bolck "def userid = changeItems.collect { userUtil.getUserByKey(it.userKey).name}" 

import com.atlassian.jira.component.ComponentAccessor;

def historyManager = ComponentAccessor.getChangeHistoryManager()
def userUtil = ComponentAccessor.getUserUtil()

def changeItems = historyManager.getAllChangeItems(issue).findAll { changeItem ->
changeItem.field == "status" && changeItem.toValues.find{ it.value == "Rejected"} && !(changeItem.fromValues.find{ it.value == "Rejected"})

def userid = changeItems.collect { userUtil.getUserByKey(it.userKey).name}

1 answer

Perhaps this would work for you: 

def userid = changeItems.collect { userUtil.getUserByKey(it.userKey).getDisplayName()}

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Jira

Make your Atlassian Cloud products more secure: our NEW admin security guide

Hey admins! I’m Dave, Principal Product Manager here at Atlassian working on our cloud platform and security products. Cloud security is a moving target. As you adopt more products, employees consta...

91 views 0 4
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