to send notification

abhi159
Kilo Sage

i created a record today now after the 4 days i have to send notification how i can do this?

1 ACCEPTED SOLUTION

@abhi159 

 

Sorry for the confusion, please check this script:

 

I assume Schedule job will execute once a day and it will check all the records of a table

 

var days = 4;
var
date = new GlideDateTime();
date.addDaysUTC(-days);
gs.info(date); // this will give 23/11/2023
var gr = new GlideRecord("incident");
gr.addQuery("sys_created_on" ,"<", date);
gr.query();
while(gr.next()){
gs.eventQUeue("TestEvent",gr);
}

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.

View solution in original post

5 REPLIES 5

@abhi159 

 

Sorry for the confusion, please check this script:

 

I assume Schedule job will execute once a day and it will check all the records of a table

 

var days = 4;
var
date = new GlideDateTime();
date.addDaysUTC(-days);
gs.info(date); // this will give 23/11/2023
var gr = new GlideRecord("incident");
gr.addQuery("sys_created_on" ,"<", date);
gr.query();
while(gr.next()){
gs.eventQUeue("TestEvent",gr);
}

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.