- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 09:21 AM
In HRSD, we us Client Role Assignment Rules to apply particular roles to the user profile. There is a Business Rule (Assign HR Roles) that runs when HR profiles are updated to add or remove those roles based on the Assignment Rules.
We recently updated the Client Role Assignment Rules, and now need to apply those rules to all existing HR profiles to make sure they have the appropriate roles based on the updated rules. The Business Rules is only triggered if the HR profile is changed. How do we get the new rules to apply to all existing HR profiles? Is that a script that needs to be run against HR profiles?
Thanks for any help or insight you can provide!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 10:53 AM
@Mark Small run a simple fix script to update any field on the HR Profiles and your business rule (Assign HR Roles) will trigger.
Here is how you can configure the fix script.
Here is the script.
var hrProfile = new GlideRecord('sn_hr_core_profile');
hrProfile.query();
while(hrProfile.next()){
hrProfile.sys_updated_on = new GlideDateTime();
hrProfile.update();
}
This script is just updating the sys_updated_on field on the profile.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 10:53 AM
@Mark Small run a simple fix script to update any field on the HR Profiles and your business rule (Assign HR Roles) will trigger.
Here is how you can configure the fix script.
Here is the script.
var hrProfile = new GlideRecord('sn_hr_core_profile');
hrProfile.query();
while(hrProfile.next()){
hrProfile.sys_updated_on = new GlideDateTime();
hrProfile.update();
}
This script is just updating the sys_updated_on field on the profile.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 03:25 PM
Thanks, I should have been more clear. The filter conditions on the Business Rule are if specific fields are changed, i.e. Employment Start Date, Employment End Date, Employment Type, etc. Would the Fix Script need to force those fields to change in order for the roles to be added or removed?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 08:27 PM
@Mark Small Yes, if the Assign HR Roles business rule has condition defined on it then the fix script needs to update one of those fields to make it run.
Alternatively, you can add one more condition Updated on changes in this BR and run our fix script, this will enable the BR to run for all the HR profiles. Afterwards, you can restore the filter conditions back to previous version by removed Updated on changes condition