The CreatorCon Call for Content is officially open! Get started here.

Why is the event not firing?

honamiUeo
Tera Contributor

■assumption

・What we want to do is send an email to the users checked in the user table

・Email property settings.

honamiUeo_0-1694677348829.png

 

 

・I wrote this code in the script include

(In fact, we will store the address obtained from the ui action)

(I put sys_id Third argument and it didn't work.)

gs.eventQueue('sendEmail', current, 'sample@aaa.co.jp', 'firstname lastname');
 
・event registration
 
honamiUeo_1-1694677566447.png

 

・notification

 honamiUeo_2-1694677610519.png

 

・Checked.

Event parm 1 contains recipient
 
 
Can someone please help me?
 
1 ACCEPTED SOLUTION

DYCM
Mega Sage

Hello @honamiUeo ,

I think the issue is from the parameter1.png2.png

sysparam_checked in UI Action

sysparm_checked in Script Include

View solution in original post

23 REPLIES 23

@honamiUeo 

in line 15 you should not use current object. please use gr object which is GlideRecord object of sys_user

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Thank you for letting us know.
I changed to the script below, but the event did not fire.

 

gs.eventQueue('sendEmail', gr, userID, userName);

@honamiUeo 

ideally it should trigger now

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

I'm sorry, what do you mean it should be activated now?

Also, there was progress to the point where it was written to the event log. Thank you very much.

 

honamiUeo_2-1694690451046.png

 

 

@honamiUeo 

so were you saying earlier that event is getting triggered but email is not sent because that's what your question said.

now that you are saying event is getting processed why email is not getting triggered?

is that user having notification preference enabled?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader