The CreatorCon Call for Content is officially open! Get started here.

Write a script to print Incident count based on priority.

Parth_S
Tera Contributor

Below is my script which is not giving expected O/P.

 

var gr = new GlideAggregate('incident');
gr.groupBy('priority');
gr.query();
var count = 0;
while(gr.next()){
    gs.info(gr.priority);
    count = count + 1;
    gs.info('Count is ' + count);
}
10 REPLIES 10

JaishreeR
Giga Guru

Hello @Parth_S 

Please find the below solution:

Count Incident Based on Priority.png