Expand my Community achievements bar.

SOLVED

Extract user primary group in a report/API

Avatar

Level 7

Hello,

I would like to extract the primary group of a user. For instance, if Group A contains a subgroup Group B, which in turn has a subgroup Group C, and my Home Group ID is set to Group C in my Workfront profile settings, is it possible to retrieve Group A in a report or in an API response?


Thanks!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hello Manish,

 

Using the API you need to work with a nested query. But I think that there is no possibility to find out how many layers your group structure has. So, if you know that the nesting is Group A -> Group B -> Group C you could do something like this:

https://<instancename>.my.workfront.adobe.com/attask/api/v18.0/user/search?fields=homeGroup:parent:parent:name&ID=<userID>

 

this looks for the homeGroup (Group C) of the User and asks for its parent (Group B) and the parent of Group B, which would be Group A.

 

If you do not know, if there is another level, unfortunately you cannot be sure to get the "Top-Group" with this approach.

 

Regards

Lars

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hello Manish,

 

Using the API you need to work with a nested query. But I think that there is no possibility to find out how many layers your group structure has. So, if you know that the nesting is Group A -> Group B -> Group C you could do something like this:

https://<instancename>.my.workfront.adobe.com/attask/api/v18.0/user/search?fields=homeGroup:parent:parent:name&ID=<userID>

 

this looks for the homeGroup (Group C) of the User and asks for its parent (Group B) and the parent of Group B, which would be Group A.

 

If you do not know, if there is another level, unfortunately you cannot be sure to get the "Top-Group" with this approach.

 

Regards

Lars

Avatar

Level 7

Hello Lars - This is useful. We have a maximum of four groups in hierarchy, so I will use it accordingly. Thank you!