Sending notification X days prior to a variable date in a task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2016 05:52 AM
I need to send an email notification to customers 7 work days prior to a variable date in a task.
I've read a lot of documentation and community entries and I've not found anything that fits my scenario. I don't think a timer would work, I need to send this PRIOR.
Here is my scenario:
Windows 10 migration.
Request is opened by the migration team. Task is created and sent to the migration team. In that task is an "actual" date variable, which is the date the customer wants their migration done.
I need a notification to be sent to that customer 7 days before that date (as a reminder).
I'm not a programmer or coder, any help with this is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2016 06:03 AM
Hi Julie,
You would need at least a small administration / code knowledge to do it.
With these requirements,
I would create a Schedule Job running every day and checking if any task meet the requirement "today = migration date - 7 days".
And in this script, I would say that for each task, an email should be sent to the right person using the "registry events".
And finally, the notification itself would contain the "contents"
So you need to use:
- Scheduled Job
- Nota Bene, the migration date should be (if I understand well your context) contained into the "variable" placeholder (example current.variables.migration_date)
- Registry event
- Notification
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2016 11:41 AM
That you for that help.
Do you have any scheduled job scripts that I could look at?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2016 08:50 AM
I found this post while I was looking for something similar. I am going to send AD password 10, 5 and 1 day/s before it expires. I am running scheduled job to query the user table. I am then adding 10 days to today and then comparing that date to the 'Next AD Password Reset" field that I created to store the date. I then log an event which I use to trigger a notification. Here is my script, hope it helps.
function resetTenDays(){
var gr = new GlideRecord('sys_user');
gr.addQuery('u_domain', 'EXT');
gr.addNotNullQuery('u_next_ad_password_reset');
gr.query();
while(gr.next()){
var gdt = new GlideDateTime();
gdt.addDaysLocalTime(10);
var gdtt = gdt.getLocalDate().toString();
var p = new GlideDateTime(gr.u_next_ad_password_reset);
var t = p.getLocalDate().toString();
var name = gr.first_name + ' ' + gr.last_name;
if (gdtt == t) {
//gs.log(gr.u_display_name + ' ' + gr.u_next_ad_password_reset + ' GDTT is ' + gdtt + ' t is ' + t + ' email' + gr.email);
gs.eventQueue('reset.password.ten.days.ext', current, gr.email, name);
} else {
//gs.log("Didn't find" + ' ' + gdtt + ' ' + gdt);
}
}
}