I am trying to set up an email notification ONLY IF a change task is past due date! The email should only be sent to the person who has been assigned the change task.
This is what I am doing :
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 recipient!!
This is the error log message:
"getEventTarget() called with invalid record reference.change_task. for event: change_task.duedate_reminder, could have been deleted"