To check user belongs to a group

heisen
Kilo Contributor

Script to check if the logged in user belongs to any one of the groups?( Not a specific group, any one of the group)

5 REPLIES 5

Kalaiarasan Pus
Giga Sage

There are already multiple response but assuming that you have the list of sys id or the group name in an array, this should help

 

var grpList = 'contains comma separated group details';

for(var i =0 ;i<grpList.length;i++){

if(gs.getUser().isMemberOf(grpList[i].trim()))
return true;

}