From 800c0cc25966b4f18b2dd885089d6c9ccb46b716 Mon Sep 17 00:00:00 2001 From: srikanthroyal932-cmyk Date: Fri, 24 Oct 2025 10:20:15 +0530 Subject: [PATCH 1/2] countAssignedUtil.js --- .../Count Assigned To Field/countAssignedUtil.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Server-Side Components/Script Includes/Count Assigned To Field/countAssignedUtil.js diff --git a/Server-Side Components/Script Includes/Count Assigned To Field/countAssignedUtil.js b/Server-Side Components/Script Includes/Count Assigned To Field/countAssignedUtil.js new file mode 100644 index 0000000000..ebb1cbfd51 --- /dev/null +++ b/Server-Side Components/Script Includes/Count Assigned To Field/countAssignedUtil.js @@ -0,0 +1,15 @@ +var countAssignedUtil = Class.create(); +countAssignedUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, { + + getCount: function() { + var ga = new GlideAggregate('incident'); + ga.addQuery('assigned_to', this.getParameter('sysparm_assignedto')); + ga.addAggregate('COUNT', 'assigned_to'); + ga.query(); + while (ga.next()) { + var assignedIncident = ga.getAggregate('COUNT', 'assigned_to'); + return assignedIncident; + } + }, + type: 'countAssignedUtil' +}); From 6c08535412b7d0366e3b1a79418c56e8d1752358 Mon Sep 17 00:00:00 2001 From: srikanthroyal932-cmyk Date: Fri, 24 Oct 2025 10:26:55 +0530 Subject: [PATCH 2/2] README.md --- .../Count Assigned To Field/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Server-Side Components/Script Includes/Count Assigned To Field/README.md diff --git a/Server-Side Components/Script Includes/Count Assigned To Field/README.md b/Server-Side Components/Script Includes/Count Assigned To Field/README.md new file mode 100644 index 0000000000..2da948e101 --- /dev/null +++ b/Server-Side Components/Script Includes/Count Assigned To Field/README.md @@ -0,0 +1,12 @@ +Count Assigned To Field + +1. Create a Script Include +2. Enable Client Callable +3. create a Function in the Script Include Class +4. Do Glide Aggregate to the Incident Table +5. Get the Parameter from the Client Script +6. Use the Aggregate - COUNT for the assigned_to field +7. Use the While Loop +8. Get the COUNT of the assigned_to field +9. Return the COUNT to Client Script +10. Based on the COUNT we can add limit the assignment of the tickets to the assigned users.