When attempting to predict the service of a case submitted by email, no prediction is made

Steps to Reproduce

On a New York or Orlando instance with:
-- "Predictive Intelligence" and "Human Resources: Core" installed
-- trained classification solution using OOB ml_x_snc_hr_case_categorization solution definition

1. Create a new HR Case record via email to invoke the "Predict COE, Service after insert" BR.

Expected: The BR in turn calls the hr_CaseAjax script include (sys_id: b25370019f22120047a2d126c42e7000) that should make the prediction for the HR Service of the new HR Case record.
Actual: No prediction is made, and the localhost logs show an error message (see below)

Additional Context:
-- Error message from logs:

2020-03-03 10:53:27 (972) worker.7 worker.7 txid=4cd77a8a1b53 WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: Cannot read property "hr_service" from undefined
Caused by error in sys_script_include.b25370019f22120047a2d126c42e7000.script at line 20


Within script include hr_CaseAjax (sys_id: b25370019f22120047a2d126c42e7000), there is a method named "predict".

Within this function, there is code that checks whether the user can read records in the "sn_hr_core_ai_configuration" table. This code is unnecessary as the records are for configuration and are not returned to the user in any way.

To fix, near line 170, change this:

   gr.addQuery('use_case', 'email_categorization');
   gr.addQuery('sys_domain', domain);
   if (!gr.canRead())
   else if (! {

To this:

   gr.addQuery('use_case', 'email_categorization');
   gr.addQuery('sys_domain', domain);
   if (! {

Related Problem: PRB1390740

Seen In

There is no data to report.

Intended Fix Version


Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-06-03 09:25:42