How to auto populate Assignment Group based on Category and SubCategory

Renata9
Tera Contributor

Is there a way to auto-populate the assignment group based on the criteria of the category and sub-category? For example, if the category is bi team and the subgroup is Cyberquery the assignment group will automatically populate to the BI Team.

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello

There are quite a few ways to do it

Onchange client script

Business rule

Assignment rule

It's upto you how you want to do it based on your instance setup

Please mark answer correct/helpful based on impact

View solution in original post

17 REPLIES 17

Terry23
ServiceNow Employee
ServiceNow Employee

I faced same issue and discovered that since I already had a default Assignment Group, the Assignment Rule will not work.  Please refer to attached.

Can you please share the onChange script? I am attempting to do the same where the assignment group will populate based of category and subcategory, but it does not take the script it leaves the assignment group no matter what catg. or subcateg. was selected. Thank you! 

manikanta ravel
Tera Contributor

Actual Task: In incident form , based on category assignment group needs to be auto populated.

I wrote a Business Rule to auto populate assignment group based on category.

when to run: before

checked: insert and update    

(function executeRule(current, previous /*null when async*/ ) {

    if (current.category.changes()) {

        var assignmentGroup = new GlideRecord('sys_user_group');
        assignmentGroup.addQuery('category', current.category);
        assignmentGroup.query();
        if (assignmentGroup.next()) {
            current.assignment_group = assignmentGroup.sys_id;
        }
     } // Add your code here

})(current, previous);
 
when my businessrule  is not working properly.