Auto assigning groups based off category / subcategory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:14 PM
Hello experts,
I need to auto assign 'assignment_group' based off category/subcategory selection on Incident. I took the assignment rule script approach but I think it does not work on change. The idea is to be able to assign/reassign category/subcategory at any given point and the assignment_group should change accordingly to notify proper team. The only thing I can think of doing business rules, but I have a lot of different group assignments based on category/subcategory, so did not want to create a lot of different business rules. What would be the best way to approach this?
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:28 PM
James,
You can use either of the following options:
1. Assignment Lookup Rules
2. Assignment Rules
You will find these under "System Policy -> Rules" menu.
Each one has its own usage and advantages. Assignment Lookup Rules also provide the flexibility where you can decide to run the rules always on every update or only when "Assignment Group" field is empty (ie only for first time assignment).
You can find relevant documentation here:
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:36 PM
Hi,
You can onChange client script on category field , which looks like below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading){
return;
}
if(newValue === ''){
g_form.setValue('assignment_group','');
}
if(newValue=='request'){
g_form.setValue('assignment_group','sys_id of the group');
}
if(newValue=='inquiry'){
g_form.setValue('assignment_group','sys_id of the group');
}
}
Thanks,
Please Hit like, Helpful or Correct if your question is answered.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:55 PM
I would prefer write a Script inlude and call that in BR..later on if any categories or sub categories added. You can change the logic in script include
//Category approvals
setCategoryApprovals: function(current)
{
if(!gs.nil(current.category))
{
if (current.category == 'abc') {
current.assignment_group=//sys_id of grp A
}
else if (current.category == 'def' || current.category == 'xyz' ) {
current.assignment_group=;//sys_id of grp B
}
}
},
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 09:25 PM
Hi James,
there are couple of questions first:
1. Do you have any custom table where you have created the combination of category, subcategory and group
2. Do you want to assign specific assignment groups on the basis of category and subacategory.
On second condition
If you want to change specific assignment group on submission of the form on the basis of cats and subcats then go with Business Rule or assignment rules.
Defining Assignment Rules - ServiceNow Wiki
On first condition
If you have a custom table and want to change the assignment group the moment you change the category and subcategory combination then go with the combination of Script include and client script. on that custom table.