please help me how to extract incident by using servers

Community Alums
Not applicable

Hi All,


We need the total number of tickets received from last 12 months by using servers.

How to extract it

 

Thanks.

1 REPLY 1

Anand Kumar P
Giga Patron
Giga Patron

Hi @Community Alums,

var gr = new GlideRecord('incident');
gr.addQuery('cmdb_ci.sys_class_name', 'cmdb_ci_server');
gr.addEncodedQuery(‘

opened _atONLast year@javascript:gs.beginningOfLastYear0@javascript:gs.endOfLastYear\’);


gr.query();

while (gr.next()) {
gs.print('Incident Number: ' + gr.getValue('number'));
}

Please mark it as solution proposed and helpful.

Thanks,

Anand