how to send notification at a particular date and time in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 01:15 AM
we have one field next review date, my requirement is send a notification 1 day prior to that next review date.
I wrote the following code to send notification but notification is triggering on current date and time only
function onAfter(current, previous) {
//This function will be automatically called when this rule is processed.
var date1 = new GlideDateTime();
var review_date=current.u_next_review_date;
date1.setDisplayValueInternal(review_date);
date1.addDays(-1);
gs.eventQueueScheduled("incident.reminder", current, gs.getUserID(), gs.getUserName(), date1.getDisplayValue());
}
Guys can u please help on this, any suggestion is helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 06:17 AM
Not sure if this helps but we have something similar so I thought I would share.
We have an after BR on the incident table on Insert and Update with the condition current.u_reminder.changes() and the following script:-
gs.eventQueueScheduled("incident.reminder", current, gs.getUserID(),
gs.getUserName(), current.u_reminder);
I didn't write it an I'm not much of a coder, so good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2015 10:19 PM
Mail is triggering as of there in field 'u_reminder' but my requirement is to send at one day before. If i modify the date in 'u_reminder' according to previous day then mail is not triggering at that date and time but it mail is triggering at current point of time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2015 10:40 PM
Hi Ravi,
You may find the below link helpful.
http://wiki.servicenow.com/index.php?title=Creating_a_Simple_Reminder_Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2015 10:49 PM
when i was adding some customizations like
var review_date=current.u_next_review_date;
date1.setDisplayValueInternal(review_date);
date1.addDays(-1);
on that date field eventQueueScheduled() method is not working