- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 12:34 AM
To achieve this I have first created a Business Rule.
When to run : onBefore
Action : Nothing
Advance :
var gdt = new GlideDateTime(); // a new GlideDateTime object
gdt.addSeconds(180); // adds 03 minutes to the date/time as an example
gs.eventQueueScheduled("incident.inserted", current, gs.getUserID(), gs.getUserName(), gdt);
}
Then I created a Custom Notification "Incident Opened for my Company" on Incident table.
Advance View:
When to Send : When Event is fired
Event Name : incident.inserted
Condition : Company is ACME Africa
Who will receive : Included my email
What it will contain: Template as "incident.itil.role"
To test this I created a test ticket with company as ACME Africa.
As soon as I submit the ticket, I get an email notification from Notification 'Incident Opened for my Company' to my mail box.
But exactly after 03 minutes again I get a duplicate email from Notification 'Incident Opened for my Company'
I want only One Notification after 03 minutes of ticket creation.
Can you please take a look and let me know how can I achieve this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2016 11:25 AM
The problem here is that you are queuing and responding to incident.inserted. When you insert the record, that will fire an occurrence of incident.inserted. Then from the business rule you are programmatically inserting another occurrence of the same event 180 seconds later. Create a custom event that isn't that one (like "incident.delayed") then programmatically queue it up. Adjust your notification to your newly created event and you should only get a single copy.
Make sense?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 03:20 AM
It sounds like a bug. Oddly, eventQueueScheduled() doesn't seem to be well documented on the developer site. There are remnants of it on the wiki.
Creating a Simple Reminder Email - ServiceNow Wiki
Let me see what dave.slusher has to say about it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2016 11:25 AM
The problem here is that you are queuing and responding to incident.inserted. When you insert the record, that will fire an occurrence of incident.inserted. Then from the business rule you are programmatically inserting another occurrence of the same event 180 seconds later. Create a custom event that isn't that one (like "incident.delayed") then programmatically queue it up. Adjust your notification to your newly created event and you should only get a single copy.
Make sense?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 11:50 AM
Thanks Dave!!
Yes It works for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 01:08 PM
Great! Can you please mark my answer correct so it will mark this question closed? Glad it is working for you.