The CreatorCon Call for Content is officially open! Get started here.

Auto assigning groups based off category / subcategory

brown9394
Tera Expert

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?

6 REPLIES 6

tarleen
Tera Contributor

You can create onChange client script on table incident


( type: Onchange ;   field name: category ).




script:


function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {


          return;


    }


if(g_form.getValue('category')=="category1")    



  { g_form.setValue('assignment_group','sys_id');       // sys_id of the assignment group



  }


else if(g_form.getValue('category')!="category1")




  { g_form.setValue('assignment_group','sys_id');


  }  


}


Hi tarleen I believe it is not recommended to use sys id directly on the scripts. Just my 2 cents:)


find_real_file.png