- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2014 07:24 AM
I am trying to set up an email notification ONLY IF a change task is 7 days past due date! The email should only be sent to the person who has been assigned the change task.
Please help!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2014 08:50 AM
I don't think you're actually looping through the records you found in your example, so gr is referencing a set of records. Try this:
var gr = new GlideRecord('change_task');
gr.addQuery('due_date', '<=', gs.nowDateTime());
gr.addQuery('active', true); //you probably want to add this so you only send reminders on open tasks
gr.query();
while (gr.next()) {
gs.eventQueue("change_task.duedate_reminder", gr, gs.getUserID(), gs.userName());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2014 10:37 AM
Setup a 7 day OLA that has a start condition of Due Date and a stop date of Work End
Setup a workflow for the OLA that sends a notification at 100% and goes only to the assigned to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2014 11:47 AM
Cant we do it by setting up a schedule job , email notification & event. Cant use OLA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2014 11:53 AM
You could absolutely use a scheduled job, event, and email notification.
Setup a scheduled job that compares the due date and the current date.
Trigger an event if it is 7 days past due date
Send out notification. Notification will have to come from the Task_SLA table and you will have to use task.assigned_to as your recipient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2014 11:59 AM
Thats what I did...It didnt work!
1)This is the script in the scheduled job :
var gr = new GlideRecord('change_task');
gr.addQuery('due_date','<=', gs.nowDateTime());
gr.query();
var count = gr.getRowCount();
if (count > 0)
{
gs.eventQueue("change_task.duedate_reminder", gr, gs.getUserID(), gs.userName());
}
2) Created an event in registry named "change_task.duedate_reminder "
3) Created an email notification when the above mentioned event is fired. Used 'aasigned_to' as the receipent!!
Tested it pressing the ''EXECUTE NOW' button in the scheduled job
PS -> I am leaving out the 7 day condition as of now!