We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6218cd5 commit 12100c4Copy full SHA for 12100c4
GlideAggregate/getTotal of aggregate value/README.MD
@@ -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).
GlideAggregate/getTotal of aggregate value/getTotal.js
@@ -0,0 +1,10 @@
+var trend = new GlideAggregate('incident');
+trend.addTrend ('closed_at','month');
+trend.addQuery('priority',1);
+trend.addQuery('state',7);
+trend.addAggregate('COUNT');
+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