Hi,
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}
if(userid)
userid.last()
Perhaps this would work for you:
def userid = changeItems.collect { userUtil.getUserByKey(it.userKey).getDisplayName()}
Discover the teamwork and precision behind success on and off the track. See how this high-performing team makes the impossible possible. Be one of the first 100 customers to register for a chance to win 2 tickets to an Atlassian Williams 2026 race.
Register now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.