gs.eventQueueScheduled method in Scheduled job

Anagha Rane1
Kilo Contributor

I have created a job which must trigger everyday at 10am. Notification needs to be triggered in exact 24 hours after approval triggered and if the approval is still in requested state. But unfortunately gs.eventQueueScheduled is not working . Every time the job runs, it sends all the approvals which are in requested state. The value stored in gdt is correct as i checked in log. So email must trigger in the date and time stored in gdt.

find_real_file.png

2 REPLIES 2

Pratiksha Kalam
Kilo Sage

Hello,

First create a event and process that one with below sysmtax

Use the gs.eventQueue('eventname',object(generally table name),'parm1','parm2');

Refer below,

http://wiki.servicenow.com/index.php?title=Event_Registry#gsc.tab=0

 

http://wiki.servicenow.com/index.php?title=Events_and_Email_Notification#gsc.tab=0

Thanks,

Pratiksha

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please use this; no need for comparing date etc

while(gr.next()){

var gdt = new GlideDateTime(gr.sys_created_on);

gdt.addDaysUTC(1);

gs.eventQueueScheduled('approval.reminder', gr, '', '', gdt);

}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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