How to display last 3 months incident records using script

rajesh47
Kilo Contributor

How to display last 3 months incident records using script

7 REPLIES 7

Ravi9
ServiceNow Employee
ServiceNow Employee

Pls share the code you have tried so far , if you are new to coding in sn - suggest to check out developer site first

Anshu_Anand_
Kilo Sage
Kilo Sage
var gr =new GlideRecord("incident");
gr.addEncodedQuery('sys_created_onONLast 3 months@javascript:gs.beginningOfLast3Months()@javascript:gs.endOfLast3Months()');
gr.query();
while(gr.next())
{
gs.info(gr.number);
}

Copy query from incident table and do gliderecord on incident.

find_real_file.png

Mark answer as correct if helpful

Regards,
Anshu

Thank you!

 

 

Bhavana Reddy
Mega Guru

where are you displaying these incident records?