Skip to content

Commit fa78c36

Browse files
script.js
Identify inactive users who still have unresolved incidents. This helps with offboarding processes and ensures incidents aren't left unattended.
1 parent 3edf0bc commit fa78c36

File tree

1 file changed

+11
-0
lines changed
  • Core ServiceNow APIs/GlideAggregate/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)