Extract user primary group in a report/API | Community
Skip to main content
_Manish_Singh
New Participant
September 1, 2024
Solved

Extract user primary group in a report/API

  • September 1, 2024
  • 1 reply
  • 563 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lgaertner

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

1 reply

lgaertner
lgaertnerAccepted solution
New Participant
September 2, 2024

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

_Manish_Singh
New Participant
September 2, 2024

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