From 6dba56b2226f6d097c174c09af87783e013a6afb Mon Sep 17 00:00:00 2001 From: srikanthroyal932-cmyk Date: Sat, 25 Oct 2025 11:46:23 +0530 Subject: [PATCH 1/2] getAssignedToCount.js --- .../getAssignedToCount.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Count Assigned To Field/getAssignedToCount.js diff --git a/Client-Side Components/Client Scripts/Count Assigned To Field/getAssignedToCount.js b/Client-Side Components/Client Scripts/Count Assigned To Field/getAssignedToCount.js new file mode 100644 index 0000000000..31105ebe56 --- /dev/null +++ b/Client-Side Components/Client Scripts/Count Assigned To Field/getAssignedToCount.js @@ -0,0 +1,18 @@ +function onChange(control,oldValue,newValue,isLoading,isTemplate) { + if(isLoading || newValue === '') { + return; + } + + var ga = new GlideAjax('countAssignedUtil'); + ga.addParam('sysparm','getCount'); + ga.addParam('sysparm_assignedto', newValue); + ga.getXML(callback); + + function callback(response){ + var answer = response.responseXML.documentElement.getAttribute("answer"); + if(answer >=5){ + g_form.addErrorMessage("Please select another person to work on this Incident, selected user is already having 5 tickets in his/her Queue"); + g_form.setValue("assigned_to", ""); + } + } +} From ae91f33edffee6bbda8d42c47165792b36282500 Mon Sep 17 00:00:00 2001 From: srikanthroyal932-cmyk Date: Sat, 25 Oct 2025 11:55:49 +0530 Subject: [PATCH 2/2] README.md --- .../Count Assigned To Field/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Count Assigned To Field/README.md diff --git a/Client-Side Components/Client Scripts/Count Assigned To Field/README.md b/Client-Side Components/Client Scripts/Count Assigned To Field/README.md new file mode 100644 index 0000000000..24bc571aa9 --- /dev/null +++ b/Client-Side Components/Client Scripts/Count Assigned To Field/README.md @@ -0,0 +1,14 @@ +Count Assigned To Field + +1. Write a Client Script name as getAssignedToCount +2. Glide the Incident Table +3. Use onChange Client Script +4. Use the Field name as "assigned_to" field +5. Glide the Script Include using "GlideAjax". +6. Call the function "getCount" from Script Include +7. Add the parameter for the newValue. +8. Use the getXML for asynchronous response. +9. Get the answer using the callback function +10. Use the logic for the more than how many tickets that error needs to populate +11. Use the addErrorMessage for marking the error message +12. Use the setValue for the "assigned_to" field.