The CreatorCon Call for Content is officially open! Get started here.

How can I find out which groups contain a role?

chrismarriott
Kilo Contributor

I'm probably missing something obvious here, but how can I find out which groups contain a particular role in Helsinki? When I look at the details of a role, the "related records" tabs show me which users have that role, but not which groups contain the role. Is there a way I can find out which groups a role has been assigned to?

Thanks,

Chris

1 ACCEPTED SOLUTION

amlanpal
Kilo Sage

Hi Chris,



You need to search in the Group Role ('sys_group_has_role') table to get your answer. You need to type sys_group_has_role.LIST in your application navigation search bar to open the List view of the table. Please find to the below snapshot where I have filtered those groups which has 'itil' role.


find_real_file.png



I hope this helps. Please mark correct/helpful based on impact


View solution in original post

7 REPLIES 7

amlanpal
Kilo Sage

Hi Chris,



You need to search in the Group Role ('sys_group_has_role') table to get your answer. You need to type sys_group_has_role.LIST in your application navigation search bar to open the List view of the table. Please find to the below snapshot where I have filtered those groups which has 'itil' role.


find_real_file.png



I hope this helps. Please mark correct/helpful based on impact


Mrudula6
Mega Guru

Hi Chris,



In a group record, right click on form --> Select Configure -->Related list --> Add "Roles" from the available column list.



Refresh the group record, you should be able to see the roles assigned to a particular group.


asit2
Kilo Expert

Here is the back ground script to find the groups having specific roles-



var grprolerec= new GlideRecord('sys_group_has_role');




grprolerec.addQuery('role','e098ecf6c0a80165002aaec84d906014');   // SYS_ID of 'catalog' role. put your role's sys_id




grprolerec.query();


while(grprolerec.next())


{


  gs.log(grprolerec.group.name);


}