PavanK960672992
Mega Patron

hi @Supriya KM ,

Please use below script to get the count of incidents which are created on past 3 days.

var ga = new GlideAggregate("incident");
ga.addEncodedQuery('sys_created_onRELATIVEGT@dayofweek@ago@03'); //get incidnets created on last 3days
ga.addAggregate("COUNT");
ga.query();
while (ga.next()) {
   gs.info("Total Count is " +ga.getAggregate("COUNT")); //get the count
}

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post