How to check logged in user is member of particular assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 05:02 AM
Hi,
Requirement is I want company field to be editable only for the users who belongs to the assignment group whose type is xyz.
I am able to check whether the user is member of a particular group.
But here we have multiple groups for TYPE = XYZ.
how to acheive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 05:11 AM
Hi
What implementations you have done for your requirements?
Thanks and regards,
Kartik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 06:01 AM
HI Pravallika,
you need to figure out the groups he belongs to ,and then push them into array to find the type of the group is XYZ
and then proceed your script :
use :script include to get user groups :

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 06:39 AM
Hi,
You can use below script logic to check user membership of group of type XYZ.
var grpMem = new GlideRecord('sys_user_grmember');
grpMem.addEncodedQuery('group.typeLIKE'+sys_id_of_type);
grpMem.addQuery('user',gs.getUserID());
grpMem.query();
if(grpMem.hasNext()){
answer = true;
}else{
answer= false;
}
Replace sys_id of type in above script.
Thanks,
Anil Lande
Thanks
Anil Lande