I need to retrieve an project Actors Full Name (i.e Bob Smith), when iterating over project roles.
Currently I am able to use:
//Gets all of the projects, along with project roles (i.e. "developer" + username and full name, i.e. bed2scp Daniel Burke ENGIT_Developer)
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){
log.error("\r\n" + projectarray.getKey() + "_" + projectrole.getName() + "=" + actorRole.getUsers().toArray() + "" + "\n" + "\r\n")
However, this only retrieves the users username i.e. bed2scp
Ideally I would like to have both like: bed2scp Daniel Burke
I tried to use:
//Gets all of the projects, along with project roles (i.e. "developer" + username and full name, i.e. bed2scp Daniel Burke ENGIT_Developer)
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){
log.error("\r\n" + projectarray.getKey() + "_" + projectrole.getName() + "=" + actorRole.getUsers().toArray() + actorRole.getDisplayName() + "" + "\n" + "\r\n")
But this method is not valid.
Please help!
Hello,
getUsers is returning a set of ApplicationUsers. You need to go through that set and get the display name for each user. Something like this should work to get them:
def userNames = actorRole.getUsers()
def displayNames = userNames.each {it.displayName}
Let me know if this helps or if you have any other questions. :)
Jenna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually have to validate all data after migration. so basically my aim is to identify the lost data during migration using rest api and python
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.