How to get a list of groups and the managers to each of those groups a user belongs to?

SV1
Kilo Contributor

How to get the list of groups a "requested for" user belongs to and the managers of those groups using a script?

3 REPLIES 3

GoBucks
Mega Sage

To briefly describe such a script...

In a server-side script you could query the sys_user_grmember table for all records where the sys_user_grmember.user field is your "requested_for" user.  The resulting set of records will contain the requested_for's groups that they are a member of within the sys_user_grmember.group field.

Next, while looping through the sys_user_grmember records, you could look up the manager of each of those groups by searching for that group in the sys_user_group table.  The manager can be found in the sys_user_group.manager field.

Are you needing a specific scripted example?  What are you doing to the record that causes this script to run? (on update, create, etc?)  And finally, once the script obtains these groups and managers, what do you need to do with that data? For example, populate the watch list field?

SV1
Kilo Contributor

I was able to resolve this issue.

Basically looped through records for current.variables.requested_for in the sys_user_grmember table and simply pushed the group.manager into an array.

Good to hear you found a solution. Feel free to mark this question correct when you get a chance.