- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:06 AM - edited 04-24-2024 06:36 AM
Hello Community,
Need help, Trying to create notification on sc_request where we need to restrict email going to user if opened_by for that request belongs to service desk group.
So normal scenario the email goes with proper condition but when I try applying below advance condition it gives me opend by, group name have printed and checked but somehow
It is not working from Gliderecord where I am looking if openedBy belongs to Service Desk group.
Can anyone suggest what is wrong.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:17 AM
I think in your code you need to take group sysid instead of group name
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:17 AM
I think in your code you need to take group sysid instead of group name
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 06:46 AM
The user I printed out gives already sysid
Groupname as tried above as sysid
Still not working it's not inthe loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:01 AM
Please paste your script here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:18 AM
// Email on table= sc_request
var openedByUser = current.getValue('opened_by');
var grpMbr = openedByUser.sys_id;
//var grpMbr = current.opened_by; gives UNDEFINED
var grp = "Service Desk";
var checkusergrp = new GlideRecord('sys_user_grmember');
checkusergrp.addQuery('user',grpMbr);
checkusergrp.addQuery('group', 'd625dccec0a8016700a222a0f7900d06');
checkusergrp.query();
if(checkusergrp.next())
{
gs.log("<<check IF checkusergrpgroupID<<<"+checkusergrp.user);
gs.log("<<check IF checkusergrpUserID<<<"+checkusergrp.group);
//return true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 04:34 AM
Yes Thanks it worked now , the issue was due to group SYSid.
Thanks a lot for helping all of you