How to set Assignment Group of catalog item/ritm based on users location

aimughal
Tera Contributor

I have 3 catalog items, and based on their location of the user who submit. the ritm either need to be assigned to {Group 1} or {Group 2}. How can I write a script/BR for this to work? I know workflows can be used for this too, but I dont have any experience with those, if that is a more efficient way then please let me know.

1 ACCEPTED SOLUTION

Hi @aimughal 

 

Apologies, I misread the question and the example above is for an INC. for an RITM the code would be

 

if(current.request.requested_for.location == '[sys_id+of_location]'){
  current.assigment_group = '[sys_id_of_group_1]'
} else {
  current.assigment_group = '[sys_id_of_group_2]'
}

 

 

View solution in original post

5 REPLIES 5

raycallan
Giga Guru

Hi @aimughal 

 

You have could write a BR something like

if(current.called_id.location == '[sys_id+of_location]'){
  current.assigment_group = '[sys_id_of_group_1]'
} else {
  current.assigment_group = '[sys_id_of_group_2]'
}

 

If the BR is on before then you don't need to update the record and you can decide if the BR is to run on insert only or if updates should change it

 

raycallan_3-1667471882541.png

 

Hi @aimughal 

 

Apologies, I misread the question and the example above is for an INC. for an RITM the code would be

 

if(current.request.requested_for.location == '[sys_id+of_location]'){
  current.assigment_group = '[sys_id_of_group_1]'
} else {
  current.assigment_group = '[sys_id_of_group_2]'
}

 

 

Hi, thanks for the reply. There's only 3 specific catalog items that i need this functionality for, would a BR still work?

Yes, you can add the following to the Condition or the use the Filters in the the Where to run tab

By adding them as a filter or condition the rule will only trigger for those 3 items

 

current.cat_item == '[sys_id_cat_1]' || current.cat_item == '[sys_id_cat_2]' || current.cat_item == '[sys_id_cat_3]'

 

 

raycallan_1-1667473543734.png