Skip to content

Commit af88988

Browse files
authored
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.
1 parent 9a8fe4f commit af88988

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//Populate Incident Assignment group based on Category
2+
//When user selects catgeory then business rule script it will populate assignment group related to the category
3+
//Before BR
4+
(function executeRule(current, previous /*null when async*/) {
5+
6+
// mapping cat to assignment group
7+
if (!current.category){
8+
retrun;
9+
}
10+
var catToGroup = {
11+
'hardware':'Hardware',
12+
'software':'Software',
13+
'network':'Network',
14+
'database':'Database'
15+
};
16+
var groupName= catToGroup[current.category];
17+
if(!groupName){
18+
return; //exit if category is not mapped
19+
}
20+
var grpName =new GlideRecord('sys_user_group');
21+
grpName.addQuery('name',groupName);
22+
grpName.query();
23+
if (grpName.next()){
24+
current.assignment_group = grpName.sys_id;
25+
}
26+
})(current, previous);

0 commit comments

Comments
 (0)