Assignment rule script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 12:35 AM
Hi
There's a record producer variable what's the nature of inquiry which is select box type based on the selection of the values assignment group should auto populate in hr cases.
There a value called documents upload in what is the nature of inquiry value by selection of that value employee details field will appear where need to select the user after selecting and submitted the form.
There are 2 hr cases will create with same hr service and description but different short description
My issue is that user selected hr cases assignment group is not populating.
May I know how to resolve the issue.
Thanks in advance. Attached the screenshot.
Hr cases are HRC1253312 AND HRC1253313
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 08:47 PM
Hello @Vamshi_ch123,
assignment_group
field on the HR case accordingly.
-
1. Define the Record Producer:Create a record producer that maps to the HR Case table (or the relevant table where HR cases are created).
-
2. Create the Select Box Variable:Within the record producer, add a select box variable named "Nature of Inquiry". Populate this variable with the different types of inquiries you want to map to different assignment groups.
-
3. Add a Script to the Record Producer:
- Go to the record producer's script field.
- Use a script like this to dynamically set the
assignment_group
:
var natureOfInquiry = producer.nature_of_inquiry; // Get the selected value
// Example mapping (replace with your actual groups and values)
if (natureOfInquiry == 'Salary Issues') {
current.assignment_group = 'your_salary_issues_group_sys_id';
} else if (natureOfInquiry == 'Benefits Enrollment') {
current.assignment_group = 'your_benefits_enrollment_group_sys_id';
} else {
current.assignment_group = 'default_hr_group_sys_id'; // Default group if no match
}
- Explanation:
natureOfInquiry
gets the selected value from your "Nature of Inquiry" select box.- The
if
statements check the value and set theassignment_group
to the appropriate group'ssys_id
. Replaceyour_salary_issues_group_sys_id
,your_benefits_enrollment_group_sys_id
, anddefault_hr_group_sys_id
with the actualsys_id
values of your assignment groups. - The
else
the statement provides a default assignment group in case no other condition is met.
- Test and Deploy: Save the record producer and test it to ensure the assignment group is being populated correctly based on the selected inquiry type. Deploy the record producer to your users.
If it is helpful, please hit the thumbs up icon and accept this solution; referring to this solution will be helpful to them.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 10:18 AM - edited 06-02-2025 10:19 AM
If you're using HR Assignment Rules, there's no longer a need to write custom scripts to access record producer variables. Instead, you can now use the Condition Builder to achieve the same functionality. Here's how to configure it:
Enable Related Fields
- In the condition builder, click "Show Related Fields" to access deeper field relationships.
Access Record Producer Variables via "Questions"
- Under the "Questions" section:
- Select Item: Click the search icon and choose the relevant Record Producer.
- Select Variable: Click the search icon again to pick the specific variable you want to use.
- Select the operator
- Select Value: Choose the value that should trigger the assignment rule.
- Under the "Questions" section:
Use Logical Operators
- Use the AND operator to combine multiple conditions if needed.
Add HR Service Condition
- Add a condition for HR Service to ensure the rule applies to the correct service.
Save the Rule
- Click Save to activate the assignment logic.