OOB HR Criteria Script Include utilization in custom Script include

Ankit Singh4
Tera Contributor

Hi All,

We have a requirement where we need to populate value of subcategory on sn_hr_core_case table as per opened for region/country and hr service.

Subcategory is a reference field which is referring to my custom table where we have "subcategory can view" list field pointing out to hr criteria table.

We have tried to customize script include where we stuck to utilize OOB script include(hr_Criteria) for above requirement.

Tried below to call OOB script include and passing sys_id of "subcategory can view" field as a parameter.

var hrcriteria_SI;
hrcriteria_SI = new sn_hr_core.hr_Criteria().getUserCountForHRCriteria(gr.u_subcategory_can_view);

Please help as it is returning 0 which is not expected result.

Any Help will be appreciated.

1 REPLY 1

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

Hi @Ankit Singh  It would be helpful to understand what you are trying to accomplish to see if there is a better way to achieve the use case.

Is the subcategory directly tied to the HR Service?

How does this interact or differ from the OOtB Topic Detail/Topic Category for your use of HR Service?

Having a good understanding of what you are trying to solve for will help us understand better so we can provide the proper guidance.

Regards,

Mike