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"); + } + + +} 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..cb464a5889 --- /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.