Skip to content

Commit 1a317da

Browse files
authored
Background script to get incident number based on priority. (#2140)
* IncidentCount.js * README.md
1 parent 07aac64 commit 1a317da

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(function() {
2+
var priorities = {};
3+
var agg = new GlideAggregate('incident');
4+
agg.addAggregate('COUNT');
5+
agg.groupBy('priority');
6+
agg.query();
7+
while (agg.next()) {
8+
var priority = agg.getDisplayValue('priority') || 'No Priority Set';
9+
var count = agg.getAggregate('COUNT');
10+
priorities[priority] = parseInt(count, 10);
11+
}
12+
for (var priority in priorities) {
13+
gs.info('Priority: ' + priority + ' | Count: ' + priorities[priority]);
14+
}
15+
})();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//To get the incident count based on priority.

0 commit comments

Comments
 (0)