- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 02:45 PM
Hi there. My company is a multinational conglomerate that routes HR cases to 3 different regions, with various teams within each region.
We currently are using HR Assignment Rules to route cases to each region based on the subject person's location using the criteria builder. We have these triplicated as we have one rule to route to groups covering the Americas, one rule that routes to groups covering EMEA and one group covering AsiaPacific.
I am needing to go one step further and do some scripting to route the case differently based on the record producer variables that are selected from the portal.
How do I gain access to the record producer variables from within the Assignment Rules script?
Our setup has the record producer dump variable outputs into the 'Description' field on the HR Cases. We have a requirement that if the selection made is 'Sales Compensation" it routes to Group A but if any other selection is made it routes to Group B.
When I try to write something like the following, it's not working
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 11:36 PM
If it's in the description field, can't you just use 'description contains "selection is 'Sales Compensation'" or however it is set in the description?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 11:36 PM
If it's in the description field, can't you just use 'description contains "selection is 'Sales Compensation'" or however it is set in the description?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 12:48 AM
@wmouser I am assuming the record producer is used to raise the HR Case. If this assumption is true then you can use the following script to route the case.
var rfc = current.variables.reason_for_change;
gs.info('RFC value '+rfc);
if (rfc == "Sales Compensation") {
current.assignment_group='9a3e60971b39469092b51138bd4bcb2a';
} else {
current.assignment_group='ec5a2c5f1bf5469092b51138bd4bcbf8';
}
If the script doesn't work, check the logs and see what value is printed in logs via gs.info on the second line of this code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 07:43 AM
Hi Sandeep - the logic would need to be hard-coded for several scenarios if I set the script on the Record Producer itself. If we only had to choose between 2 groups it might work for us but we technically have 6 group options between the 2 groups (tier 1 / 2) and the 3 different regions so that script could become difficult to maintain.
Thank you for taking the time to offer your thoughts!