You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A background script that generates a comprehensive report showing the total number of incidents grouped by priority level in your ServiceNow instance.
2
+
3
+
## What It Does
4
+
5
+
The script:
6
+
1. Creates a GlideAggregate query on the incident table
7
+
2. Groups incidents by their priority field
8
+
3. Counts the total number of incidents for each priority level
9
+
4. Handles cases where priority is not set (displays as "No Priority Set")
10
+
5. Outputs a formatted report showing priority names and their corresponding counts
11
+
12
+
## Sample Output
13
+
14
+
```
15
+
Priority: 1 - Critical | Count: 15
16
+
Priority: 2 - High | Count: 47
17
+
Priority: 3 - Moderate | Count: 123
18
+
Priority: 4 - Low | Count: 89
19
+
No Priority Set | Count: 3
20
+
```
21
+
22
+
## Configuration Options
23
+
24
+
-**Date filtering**: Add `.addQuery('opened_at', 'DATEPART', 'Today@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)')` to get today's incidents only
25
+
-**State filtering**: Add `.addQuery('state', '!=', 7)` to exclude closed incidents
26
+
-**Assignment filtering**: Add `.addQuery('assignment_group', 'group_sys_id')` to focus on specific teams
0 commit comments