- 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
Hi @Nisha30 ,
Group and user are reference fields present on gr_user_grmember table please use sys_id while adding queries.
please find below attached screenshot for refrence:-
var grUser= new GlideRecord('sys_user_grmember');
grUser.addQuery('group','019ad92ec7230010393d265c95c260dd');
grUser.addQuery('user','62826bf03710200044e0bfc8bcbe5df1');
grUser.query();
if(grUser.next())
{
gs.print("hello");
}
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 06:50 AM
Hi @Nisha30 ,
you are setting like this:-
group = "service desk " then you can't get sys_id like this group.sys_id.
Go to "sys_user_group" table and copy sys_id of service desk record.
and then set like this group= sys_id copied from sys_user_group table of service desk record.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:00 AM
Tried with Sys id hard coding it but user I have to take dynamically , group system id is okay to be hard-coded. It is working if I put sysid of both user and group .
But Something not working when I hardcode system id of group and dynamically .
Any way to resolve this
Thanks