Skip to content

Commit bb69ba1

Browse files
Create a new branch for this commit and start a pull request
1 parent 08cbdc7 commit bb69ba1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var ga = new GlideAggregate('incident');
2+
ga.addAggregate('COUNT', 'sys_id');
3+
ga.groupBy('caller_id');
4+
ga.orderByAggregate('COUNT','sys_id');
5+
ga.setLimit(4);
6+
ga.query();
7+
8+
9+
while (ga.next()) {
10+
var count = ga.getAggregate('COUNT', 'sys_id');
11+
var userName = ga.getDisplayValue('caller_id');
12+
13+
gs.log('user: ' + userName + ', Incident count: ' + count);
14+
}

0 commit comments

Comments
 (0)