Skip to content

Commit 0bd6211

Browse files
committed
improved read me
1 parent ef1d3fd commit 0bd6211

File tree

1 file changed

+26
-1
lines changed
  • Server-Side Components/Background Scripts/Get incident count based on priority

1 file changed

+26
-1
lines changed
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
//To get the incident count based on priority.
1+
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

Comments
 (0)