0

GlideAggregate use case :Write a script to show count of incident for each state which are updated today

gs.print('State\\tIncident Count');

var grInc=new GlideAggregate('incident');
grInc.addEncodedQuery('sys_updated_onONToday@javascript:gs.beginningOfToday()@javascript: gs.endOfToday()');
grInc.addAggregate('COUNT','state');
grInc.query();
while(grInc.next()){
gs.print(grInc.state. getDisplayValue()+'\t'+grInc. getAggregate('COUNT','state'));
}

Result :

GlideAggregate use case :Write a script to show count of incident for each state
Working Code Asked question July 14, 2023