Get Role and all its contains rolesSummary We know one role can contains some sub roles, and those sub roles can contains some other roles in it, sometime we want to know if some roles are contained in a specific role. But from Table[sys_user_role_contains] we can only see the relationship between the role and its directly sub roles, we cannot see how many roles in it. Here is a script helps you to find which roles are inherited from a specific role. var sysID = ["2831a114c611228501d4ea6c309d626d"]; // replace sysID to the role's sys_id that you want to check var list = []; for (id in sysID) { getRoles(sysID[id]); } gs.info(list); function getRoles(sysID) { var role = new GlideRecord("sys_user_role"); role.get(sysID); //gs.info(role.getValue("name")); if (list.indexOf(role.getValue("name")) == -1) list.push(role.getValue("name")); var gr = new GlideRecord("sys_user_role_contains"); gr.addQuery("role", sysID); gr.query(); while(gr.next()) { getRoles(gr.getValue("contains")); } } Release all