Get FullName from actorRole

Daniel Burke January 17, 2018

Is it possible to add to this code in order to retrieve a full user name (i.e. John Smith) as well as their username, from getting the Actor Roles?

 for(Project projectarray in projectArray){
for(ProjectRole projectrole in projectRoles){
def actorRole = projectRoleManager.getProjectRoleActors(projectrole, projectarray)  //projectLead = projectarray.getProjectLead()
if(actorRole.getUsers().toArray().size() >= 1){
file
.append( "" + projectarray.getKey() + "_" + projectrole.getName() + " " + "= " + actorRole.getUsers().toArray() + "\n")
}
else if(actorRole.getUsers().toArray().size() < 1){ }

 

 

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2018

It would be something like this

actorRole.getUsers().each{it.getDisplayName()} 

Daniel Burke January 17, 2018

hmm, doesn't appear to work. 

Nothing gets returned when I use this function.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2018

What do you want to return? There will be an array of full user names not a singe full user name. Do you want to return an array?

Daniel Burke January 17, 2018

yes, currently I'm able to just return the username i.e. bob123, which is concurrent with the project actoRole, however, I would like to get the Full Name too. 

i.e. [bob123] [Bob Smith] 

Daniel Burke January 18, 2018

Any ideas please..? :) 

Suggest an answer

Log in or Sign up to answer