From f575a5107277e582e84659fe173011edafcdf287 Mon Sep 17 00:00:00 2001 From: Indra-kolge <123245160+Indra-kolge@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:53:14 +0530 Subject: [PATCH 1/2] IncidentCount.js --- .../IncidentCount.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Server-Side Components/Background Scripts/Get incident count based on priority/IncidentCount.js diff --git a/Server-Side Components/Background Scripts/Get incident count based on priority/IncidentCount.js b/Server-Side Components/Background Scripts/Get incident count based on priority/IncidentCount.js new file mode 100644 index 0000000000..e6b1b099c1 --- /dev/null +++ b/Server-Side Components/Background Scripts/Get incident count based on priority/IncidentCount.js @@ -0,0 +1,15 @@ +(function() { + var priorities = {}; + var agg = new GlideAggregate('incident'); + agg.addAggregate('COUNT'); + agg.groupBy('priority'); + agg.query(); + while (agg.next()) { + var priority = agg.getDisplayValue('priority') || 'No Priority Set'; + var count = agg.getAggregate('COUNT'); + priorities[priority] = parseInt(count, 10); + } + for (var priority in priorities) { + gs.info('Priority: ' + priority + ' | Count: ' + priorities[priority]); + } +})(); From fb7b64d0aa74a0852bc5cc2e2cc1a5fee6d35a5a Mon Sep 17 00:00:00 2001 From: Indra-kolge <123245160+Indra-kolge@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:54:04 +0530 Subject: [PATCH 2/2] README.md --- .../Get incident count based on priority/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Server-Side Components/Background Scripts/Get incident count based on priority/README.md 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 new file mode 100644 index 0000000000..cce3e61a7e --- /dev/null +++ b/Server-Side Components/Background Scripts/Get incident count based on priority/README.md @@ -0,0 +1 @@ +//To get the incident count based on priority.