- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi everyone,
I'm working on a ServiceNow HRSD implementation and need some help with an Assignment Rule.
I'm using the table sn_hr_core_case_workforce_admin. The assignment group is already determined by assignment rule , and I need to populate the Assigned to field using a custom reference field on the HR Profile table (sn_hr_core_profile).
The HR case has a reference field called hr_profile, which points to the relevant HR Profile record.
I tried the following script in the Assignment Rule's Script field:
if (!current.getValue('hr_profile')) {
// No HR Profile available
} else {
var profile = current.hr_profile.getRefRecord();
if (profile.isValidRecord()) {
var payrollAgent = profile.getValue('reference field);
if (payrollAgent) {
current.setValue('assigned_to', payrollAgent);
}
}
}
owever, the script does not populate the Assigned to field as expected.
I also tested retrieving the payroll agent from the HR Profile in a Before Insert Business Rule, and that approach worked but the assignment group didn t populate and the state comes work in progress. However, I would prefer to achieve this using the Assignment Rule rather than creating a Business Rule.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Okay, then I would try setting both values from the script side alone. I have seen similar "bugs" when trying to combine script with "no code" options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
It could also be some matching rule interference actually. Are you using AWA?
You could try to keep the group in the assignment rule and then the scripted part in a matching rule?