Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Email notification advance condition issue

Nisha30
Kilo Sage

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 

1 ACCEPTED SOLUTION

Maddysunil
Kilo Sage

@Nisha30 

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

 

View solution in original post

13 REPLIES 13

Ranjit Nimbalka
Mega Sage

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

Tried with Sys id .as well not works any syntax missing not sure .

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

 

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