Incident opened by group info
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:42 AM
Hi
How do I check if the Opened by (reference field) on an incident is part of a specific group through scripting.
gs.isMemberOf() is from GildeSession and this is not working on Glide Record.
Thanks
Kiran
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 09:46 AM - edited 03-21-2024 09:47 AM
Hi @VENKAT SHIVA KI ,
Here is a server side code to check if user is part of the group or not -
var member = new GlideRecord('sys_user_grmember');
member.addQuery('user', current.opened_by); // replace "current.opened_by" with the actual field name
member.addQuery('group', '<sys_id_group>');// replace <sys_id_group> with actual sys_id of group.
member.query();
if(member.next()){
gs.info("User is Member of the Group");
}
else{
gs.info("User is Not a Member of the Group");
}