Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get FullName from actorRole

Daniel Burke January 17, 2018 edited

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 edited

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
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events