The CreatorCon Call for Content is officially open! Get started here.

How can I bypass specific matching rules for certain HR services without modifying the OOTB matching

ShilpaSD
Tera Expert

There are below out-of-the-box (OOTB) matching rules applied to the HR Task table:

  • HR Task: Agents by Skills
  • HR Task: Agents by Skills and Country

For some of our HR Services, we want to bypass these matching rules.

However, we do not want to make any changes (conditions) to the these OOTB matching rules.

What is the best approach to achieve this?

 

As of now we have modified conditions on OOTB matching rules based on HR Service. Pl refer attached screen evidence for same. We need to avoid this.

 

ShilpaSD_0-1755847952586.png

 

4 REPLIES 4

kaushal_snow
Mega Sage

Hi @ShilpaSD ,

 

** Recommended Approach: Add Custom Script Logic in hr_AssignmentUtil - Script Include **

 

ServiceNow’s OOTB matching system utilizes the hr_AssignmentAPI, which delegates agent lookup to the hr_AssignmentUtil script include. You can intercept this process and conditionally bypass matching for specific HR services.

 

Steps to Customize:

 

Locate the script include hr_AssignmentUtil.

Identify where it’s fetching group members using GlideRecord queries.

 

Add Conditional Logic: Before the query runs, check the HR service of the case:

 

if (taskRecord.hr_service == 'specific_service_sys_id') {
return [];
}


This ensures that when a case has the target HR service, no matching rules apply, and hr_AssignmentAPI returns no agents, so assignment can fall back to the next logic or manual assignment.

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

Thanks Kaushal.

But this solution is not helpful to us since its again involved customization to OOTB "hr_AssignmentUtil" script include.

We are restricted to do any changes to OOTB.

M Iftikhar
Tera Sage

Hi @ShilpaSD ,

Instead of editing OOTB, create a new matching rule.

Add conditions to exclude specific HR Services.

Place this custom rule at higher priority so it runs first and prevents OOTB rules from firing.

If my response helped, please mark it correct.
Thanks.

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Thanks M Iftikhar for solution.

Tried but its not working. Any further suggestion.