top 5 incident tickets created on the first of this month.(or select a pastdate of your selection)

Jazrojas
Tera Contributor

Here is the answer 

Using Fix Script 

var increat = new GlideRecord( 'incident');// table
increat.addEncodedQuery("sys_created_onON2024-05-06@javascript:gs.dateGenerate('2024-05-06','start')@javascript:gs.dateGenerate('2024-05-06','end')");
increat.setLimit(5);
increat.query();// look for the records
while(increat.next()) {//do the following
 gs.print(increat.number);    
}
gs.print(increat.getRowCount());

 

 

Jazrojas_3-1715979257241.png

 

 

 

Jazrojas_2-1715979182804.png

 

0 REPLIES 0