Skip to content

Commit 12100c4

Browse files
To show total number of closed P1 incidents which was illustrated in a trend (count of incident every month). (#892)
1 parent 6218cd5 commit 12100c4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### GlideAggregate - getTotal()
2+
3+
#### Script to get total of aggregate value
4+
5+
Example
6+
To show total number of closed P1 incidents which was illustrated in a trend (count of incident every month).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var trend = new GlideAggregate('incident');
2+
trend.addTrend ('closed_at','month');
3+
trend.addQuery('priority',1);
4+
trend.addQuery('state',7);
5+
trend.addAggregate('COUNT');
6+
trend.query();
7+
while(trend.next()) {
8+
gs.print(trend.getValue('timeref') + ': ' + trend.getAggregate('COUNT'));
9+
}
10+
gs.print('Total closed incidents: ' + trend.getTotal('COUNT'));

0 commit comments

Comments
 (0)