Skip to content

Commit ab49a77

Browse files
script.js
Count Inactive Users with Active incidents
1 parent 6750b61 commit ab49a77

File tree

1 file changed

+11
-0
lines changed
  • Client-Side Components/Client Scripts/Count Inactive Users with Active incidents

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var ga = new GlideAggregate('incident');
2+
ga.addQuery('active', true);
3+
ga.addQuery('assigned_to.active', false);
4+
ga.addAggregate('COUNT', 'assigned_to');
5+
ga.query();
6+
7+
while (ga.next()) {
8+
var inactiveUser = ga.assigned_to.getDisplayValue();
9+
var taskCount = ga.getAggregate('COUNT', 'assigned_to');
10+
gs.info("Inactive user " + inactiveUser + " has " + IncidentCount + " active tasks.");
11+
}

0 commit comments

Comments
 (0)