Unable to locate sn_hr_core_case ******* for inbound email processing

V_18
Giga Contributor

If I use email client from the case form. And email someone who is not Opened For, Subject Person or anyone on the Watch List. Then my inbound action is unable to capture their response and set the comment with their response. I get the following error

Unable to locate sn_hr_core_case ********************************** for inbound email processing

Any suggestion on how to fix this?

 

thanks

Vadim

 

 

4 REPLIES 4

Ian Mildon
Tera Guru

We are experiencing the same/similar issue and HI has logged it as PRB1370157

(The way the Inbound action process the email is If the user sending email does not have privileges to open the HR record, then the target would not be set. However System admin should be able to read Email for HR Case that does not have "target_table" set) 

They are in the process of determining if there is a possible workaround and are slating Orlando as the fix target.

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

The actual issue is a query business rule called "restrict query" that runs on sn_hr_core_case and inserts a background filter.  When the system process that processes emails runs, it cannot find the case because this business rule as it cannot find the case because of the conditions in it.  It has all the above restrictions in it: opened_for, subject person, watch list, etc.

You could edit the conditions to allow others to update as applicable.

Sai Anna
ServiceNow Employee
ServiceNow Employee
Yep. This is due to Query Business Rule on HR Case table. OOTB query BR triggers even for Inbound action. That is being evaluated against sender email address account. One thing you can do is on condition field add “gs.getSession().isInteractive()”. Even though OOTB script has gs.isInteractive() that wouldn’t work.

Hi,

Our recipients utilize 'vanity' emails when they respond, so they are not found in the queries.  Can you tell me what you mean by adding “gs.getSession().isInteractive()”?  That is part of the original query, or do you mean to add that in as an .addorcondition?

Condition:

gs.getUser().getName() != 'system' && (!new hr_Utils().checkUserHasRole(hr.ROLE_HR_CASE_READER)) && (gs.getUser().getName() != 'guest' || gs.getProperty("sn_hr_core.restrict_guest_email", "true") == "true")

Script:

if (gs.isInteractive() || gs.getCallerScopeName() != 'sn_hr_le') {
    var userId = gs.getUserID();
    if (userId !== hr_Utils.userID)
        hr_Utils.initializeQueryVariables();
    current.addQuery("opened_by", userId)
        .addOrCondition("opened_for", userId)
        .addOrCondition("parent.ref_sn_hr_core_case.opened_for", userId)
        .addOrCondition("watch_list", "CONTAINS", userId)
        .addOrCondition("sys_id", "IN", hr_Utils.getMyCasesWithApprovals() + ',' + hr_Utils.getMyCasesWithTasks())
        .addOrCondition('hr_service.subject_person_access', true).addCondition('subject_person', userId);
}