- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 02:48 AM - edited ‎11-03-2022 02:55 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 03:45 AM - edited ‎11-03-2022 03:45 AM
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]'
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 03:40 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 03:45 AM - edited ‎11-03-2022 03:45 AM
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]'
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 03:56 AM
Hi, thanks for the reply. There's only 3 specific catalog items that i need this functionality for, would a BR still work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2022 04:06 AM - edited ‎11-03-2022 04:06 AM
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]'