Just when you thought gs.eventQueue() is a marvel in ServiceNow, how happy would you get when you know you can schedule it to trigger an event when u want?
Just pass the record parameter, parm1 and parm2, and then the time value as an object, to the gs.eventQueueScheduled() function.
gs.eventQueueScheduled('eventName', gr/current, 'parm1', 'parm2', timeObject)
For instance, to close a ticket after 3 days from the time of update, we will do something like this:
var gdt = new GlideDateTime('sys_updated_on');
gdt.addDaysUTC(3);
gs.eventQueueScheduled('eventName', current, 'parm1', 'parm2', gdt);
Comentários