How to search list of incidents

senthilsubbaiya
Kilo Explorer

Hi Friends,

I would like to search a list of tickets (around 300 incidents). Please assist.

OR between each incident allows me only certain range.

6 REPLIES 6

Chuck Tomasi
Tera Patron

Hi,



This is done with filters and breadcrumbs. Very easy to use.



Recommended reading:


Using Filters and Breadcrumbs - ServiceNow Wiki


Chuck Tomasi
Tera Patron

What's more, you can also right click on a list value and select Show Matching or Filter Out (I really wish more apps had this) to quickly build the filter.



find_real_file.png



find_real_file.png


Chuck Tomasi
Tera Patron

If I misunderstood (after reading a second time) you may be referring to scripting... in that case, you can use the GlideRecord API.



Recommended reading:




GlideRecord - ServiceNow Wiki



Let me know if one of those random answers hits the mark.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Senthilkumar,



If you are looking for a script then you can refer the sample here and adjust it accordingly as per your req. For ex the below one will filter all active records and return the row count.


incidentCount()


function incidentCount()


{


var gr = new GlideRecord('incident');


gr.addQuery('active', true);


gr.query();


while(gr.next())


  {


  gs.info(gr.getRowCount() + ' incidents found');


}


}


The same script you can fire from background script. More info here.


Background Scripts — ServiceNow Elite



If that doesn't answer your question then please elaborate further on your req.