Notification for Overdue Changes

Alex Saager
Tera Contributor

Hi there,

I wanted to know if there was a simple way to notify users of any overdue changes they have, so anything active that's passed the planned or actual end date.

I don't have any scripting experience, so wondered if there was anything OOB I could use to achieve this.

Many thanks,

Alex

1 ACCEPTED SOLUTION

Danish6
Giga Expert

Hi Alex,

First Register an Event

Second create a schedule job on Change table runs on daily basis as per your time selection which will check all the records in the change table what are the overdue records and after that once the records found fire an event which can be used to notify the user. kindly find the below script for Schedule job.

var rightNow = new GlideDateTime();

// Query the database for change records with passed or actual end date field values older
var overdueRecords = new GlideRecord('change_request');
overdueRecords .addQuery('actual end date field name','<=',rightNow);
overdueRecords .query();
while(overdueRecords .next()){
gs.eventQueue('Event Name',current,current.number,gs.getUserName());
}

And last After this create a notification based on the "Fired By Event"

Let me know if you need more help

 

 

 

View solution in original post

1 REPLY 1

Danish6
Giga Expert

Hi Alex,

First Register an Event

Second create a schedule job on Change table runs on daily basis as per your time selection which will check all the records in the change table what are the overdue records and after that once the records found fire an event which can be used to notify the user. kindly find the below script for Schedule job.

var rightNow = new GlideDateTime();

// Query the database for change records with passed or actual end date field values older
var overdueRecords = new GlideRecord('change_request');
overdueRecords .addQuery('actual end date field name','<=',rightNow);
overdueRecords .query();
while(overdueRecords .next()){
gs.eventQueue('Event Name',current,current.number,gs.getUserName());
}

And last After this create a notification based on the "Fired By Event"

Let me know if you need more help