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()}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.