diff --git a/Client-Side Components/Client Scripts/Auto-Fill Assignment Group Based on Category/README.md b/Client-Side Components/Client Scripts/Auto-Fill Assignment Group Based on Category/README.md new file mode 100644 index 0000000000..88b5a99c9f --- /dev/null +++ b/Client-Side Components/Client Scripts/Auto-Fill Assignment Group Based on Category/README.md @@ -0,0 +1,7 @@ +This ServiceNow **Client Script** automatically assigns the **Assignment Group** based on the selected **Category** on the Incident form. +It helps to route incidents to the right support teams quickly, improving efficiency and reducing manual errors. + +Script Type +**Type:** onChange +**Applies to Table:** `incident` +**Field Name:** `category` diff --git a/Client-Side Components/Client Scripts/Auto-Fill Assignment Group Based on Category/script.js b/Client-Side Components/Client Scripts/Auto-Fill Assignment Group Based on Category/script.js new file mode 100644 index 0000000000..66bdfffd17 --- /dev/null +++ b/Client-Side Components/Client Scripts/Auto-Fill Assignment Group Based on Category/script.js @@ -0,0 +1,11 @@ +function onChange(control, oldValue, newValue) { + if (newValue == 'hardware') { + g_form.setValue('assignment_group', 'Hardware Support'); + } else if (newValue == 'software') { + g_form.setValue('assignment_group', 'Software Support'); + } else if (newValue == 'network') { + g_form.setValue('assignment_group', 'Network Team'); + } else { + g_form.clearValue('assignment_group'); + } +}