Pradeep Sharma
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.