From 0bd62119560656c8002e500ce9ca5d3884e3f7fe Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Oct 2025 07:06:02 -0700 Subject: [PATCH] improved read me --- .../README.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Server-Side Components/Background Scripts/Get incident count based on priority/README.md b/Server-Side Components/Background Scripts/Get incident count based on priority/README.md index cce3e61a7e..9fe73541fa 100644 --- a/Server-Side Components/Background Scripts/Get incident count based on priority/README.md +++ b/Server-Side Components/Background Scripts/Get incident count based on priority/README.md @@ -1 +1,26 @@ -//To get the incident count based on priority. +A background script that generates a comprehensive report showing the total number of incidents grouped by priority level in your ServiceNow instance. + +## What It Does + +The script: +1. Creates a GlideAggregate query on the incident table +2. Groups incidents by their priority field +3. Counts the total number of incidents for each priority level +4. Handles cases where priority is not set (displays as "No Priority Set") +5. Outputs a formatted report showing priority names and their corresponding counts + +## Sample Output + +``` +Priority: 1 - Critical | Count: 15 +Priority: 2 - High | Count: 47 +Priority: 3 - Moderate | Count: 123 +Priority: 4 - Low | Count: 89 +No Priority Set | Count: 3 +``` + +## Configuration Options + +- **Date filtering**: Add `.addQuery('opened_at', 'DATEPART', 'Today@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)')` to get today's incidents only +- **State filtering**: Add `.addQuery('state', '!=', 7)` to exclude closed incidents +- **Assignment filtering**: Add `.addQuery('assignment_group', 'group_sys_id')` to focus on specific teams \ No newline at end of file