From 7d7f2c13dd59e95e22bb8ffce560ffdf3f343c8a Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:49:16 +0530 Subject: [PATCH 1/3] ReadMe.md --- .../Client Scripts/Assigned to user changes count/readme.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Assigned to user changes count/readme.md diff --git a/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md b/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md new file mode 100644 index 0000000000..87c4148d7e --- /dev/null +++ b/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md @@ -0,0 +1,3 @@ +When the Assigned to field on an Incident record changes: +1. Automatically calculate how many incidents are currently assigned to the same user. +2. Show this count in a alert message. From 0c8bbf253bf431123473c426a55c96dce3cbce84 Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:52:06 +0530 Subject: [PATCH 2/3] ReadMe.md --- .../Client Scripts/Assigned to user changes count/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md b/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md index 87c4148d7e..cb464a5889 100644 --- a/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md +++ b/Client-Side Components/Client Scripts/Assigned to user changes count/readme.md @@ -1,3 +1,3 @@ -When the Assigned to field on an Incident record changes: +>**When the Assigned to field on an Incident record changes:** 1. Automatically calculate how many incidents are currently assigned to the same user. 2. Show this count in a alert message. From 47960eff4b54daf852a5d12e768d57cb9b3a703d Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:54:39 +0530 Subject: [PATCH 3/3] Code.js --- .../Assigned to user changes count/code.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Assigned to user changes count/code.js diff --git a/Client-Side Components/Client Scripts/Assigned to user changes count/code.js b/Client-Side Components/Client Scripts/Assigned to user changes count/code.js new file mode 100644 index 0000000000..0076cd97dc --- /dev/null +++ b/Client-Side Components/Client Scripts/Assigned to user changes count/code.js @@ -0,0 +1,18 @@ +function onChange(control, oldValue, newValue, isLoading, isTemplate) { + if (isLoading || newValue === '') { + return; + } + + //Type appropriate comment here, and begin script below + alert("user sys_id " + newValue); + var aj = new GlideAjax('assignedtochange'); //calling Script Include + aj.addParam('sysparm_name', 'assigned'); //calling the function + aj.addParam('sysparm_assign', newValue); //passing the parameter + aj.getXMLAnswer(answer); + + function answer(response) { //response = count of incidents + alert ("Assigned to has already been an part of " + response + " Incidents"); + } + + +}