how to find number of incidents

M Lohith Datta
Tera Contributor

Hi, 

My doubt is how to find the count of incidents created in the last 5 min?, is there any way(filter or script) to find the count ?if there is any kindly let me know.

Thanks,

Datta.

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

like this

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

like this

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

HI Ankur,

Thanks a lot !!

Kalyani Jangam1
Mega Sage
Mega Sage

Hi, Please use below script

var gr=new GlideRecord("incident");
gr.query();
while(gr.next()){
var dateString1 = new GlideDateTime(gr.sys_created_on); //Created Date
var dateString2 = new GlideDateTime(); // Current Date
var diffSeconds = gs.dateDiff(dateString1, dateString2, true);
diffMins = diffSeconds/60;
var num=Math.round(diffMins);
if(num<=5){ // Equal or within 5 minute
gs.info("number of incident---"+gr.number);
}

}

 

Mark Helpful, if it will fulfill your requirement