- 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-25-2024 04:40 AM
Happy to help you..Keep learning 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:01 AM
Hi @Nisha30
Try this:
var openedBy= current.opened_by;
var gr = new GlideRecord('sys_user_grmember'); // Table stores the mapping of user and group.
gr.addQuery('user', openedBy);
gr.addQuery('group', '<sys_id_group>');// replace <sys_id_group> with actual sys_id of Service Desk group.
gr.query();
if(gr.next()){
answer=false; //do not send email when opened by is part of Service Desk assignment group
}
else{
answer =true;
}
Please mark the answer correct/helpful if it resolved your query.Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:25 AM
Pasted my script
Current.opened_by gives undefined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 08:41 AM
Hi @Nisha30 ,
current.opened_by should give you the sys_id of the opened by in the form.
then try to use this :
var openedBy= current.getValue('opened_by');
Please mark the answer correct/helpful if it resolved your query.Thanks!