From af88988e86199c5d5d048b200439748e32e3dd6d Mon Sep 17 00:00:00 2001 From: SUMANTH GOLLA <113332783+sumanth1710@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:55:52 +0530 Subject: [PATCH] Create Auto Populate assignment group This Business Rule automatically assigns an Assignment Group based on the selected Category in the Incident form. It uses a predefined mapping between categories like hardware, software, network, and database to their respective support groups. When an incident is created or updated, the script checks the category and fetches the matching group from the sys_user_group table. If a match is found, it sets that group as the assignment_group. This ensures incidents are routed to the correct teams automatically, reducing manual effort and assignment errors. --- .../Auto Populate assignment group | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Server-Side Components/Business Rules/Auto Populate assignment group diff --git a/Server-Side Components/Business Rules/Auto Populate assignment group b/Server-Side Components/Business Rules/Auto Populate assignment group new file mode 100644 index 0000000000..ab0123288a --- /dev/null +++ b/Server-Side Components/Business Rules/Auto Populate assignment group @@ -0,0 +1,26 @@ +//Populate Incident Assignment group based on Category +//When user selects catgeory then business rule script it will populate assignment group related to the category +//Before BR +(function executeRule(current, previous /*null when async*/) { + + // mapping cat to assignment group + if (!current.category){ + retrun; + } + var catToGroup = { + 'hardware':'Hardware', + 'software':'Software', + 'network':'Network', + 'database':'Database' + }; + var groupName= catToGroup[current.category]; + if(!groupName){ + return; //exit if category is not mapped + } +var grpName =new GlideRecord('sys_user_group'); +grpName.addQuery('name',groupName); +grpName.query(); +if (grpName.next()){ + current.assignment_group = grpName.sys_id; +} +})(current, previous);