How to delay the event in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 08:07 AM
Hi All,
How to delay the event in ServiceNow
I have identified gs.sleep() method but my lead is not interested use this function
I have used gs.eventQueueScheduled("event_name",current,'','',time);
This is not working as expected,
Am I doing any mistake
I want to add one minute to the event queue processing time
Once the Event is created it should be processed after one minute
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 08:18 AM
Hi @Shantharao
May i know what value you are passing as "time"?
The last parameter should be date/time type object.
var gdt = new GlideDateTime();// get current time
gdt.addSeconds(60);
gs.eventQueueScheduled('<event_name>', current, '', '', gdt);
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 08:25 AM
Hi @Shantharao ,
you have to pass GlideDateTime object as a parameter
expiration | Object | Optional. GlideDateTime object or a date/time type element that specifies the date and time to process the event. Default: Current date/time |
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya