Skip to content

Commit 3fdfd05

Browse files
authored
script.js
1 parent 599f55e commit 3fdfd05

File tree

1 file changed

+17
-0
lines changed
  • Server-Side Components/Background Scripts/Critical Incidents Created Today by assignment group

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//Count of Critical Incidents Created Today (by Assignment Group)
2+
(function() {
3+
var ga = new GlideAggregate('incident');
4+
ga.addQuery('priority', '1'); // Critical priority
5+
6+
var start = new GlideDateTime();
7+
start.beginningOfToday(); // start of the day
8+
ga.addQuery('sys_created_on', '>=', start);
9+
ga.groupBy('assignment_group');
10+
ga.addAggregate('COUNT');
11+
ga.query();
12+
13+
gs.print("Critical Incidents Created Today (by Assignment Group):");
14+
while (ga.next()) {
15+
gs.print((ga.assignment_group.getDisplayValue() || "Unassigned") + " → " + ga.getAggregate('COUNT'));
16+
}
17+
})();

0 commit comments

Comments
 (0)