Notification to be sent only once for the same record

Rex Shi
Giga Contributor

Hi Guys,

I have setup a schedule job runs each day and filter all the changes passed the planned end date didnt get close off then trigger an event called change.pass.end.date then triggers the notification to the change owners. but the problem i have is that notification will get send everyday when the schedule runs, is there a way to send notification only once for one change record ? or is there a better way of doing this ?

script in the schedule job:

var gr = new GlideRecord('change_request');
gr.addEncodedQuery('active=true^end_date<javascript:gs.beginningOfToday()^stateIN-4,-2,-1,0');

gr.query();

while (gr.next()) {

gs.eventQueue(".change.pass.end.date", gr);

}

 

Thanks,

6 REPLIES 6

Rex Shi
Giga Contributor

thanks muhammad, but i am trying to think of a way without adding extra fields to the change table.

G Bhargavi
Tera Contributor

Hi Rex , Did you manage to do this without adding extra field ? If yes please let me know how to achieve that