HRSD - Inbound Email Case Creation

mdshahvez11
Tera Contributor

Hello everyone,

We are currently processing incoming emails in ServiceNow for HR cases using an Inbound Email Action.
While the emails are being received successfully, the target record is coming up empty when replies are sent from Gmail.

However, when replying from Outlook, it works as expected and the case is identified correctly based on our existing logic.

The error we are encountering is:

"Unable to locate sn_hr_core_case sys_id for inbound email processing."


mdshahvez11_1-1751383681605.png

 

 

This suggests that ServiceNow is unable to map the reply to the correct HR case when coming from Gmail.

Below is the Script we are using in Replying Inbound Action : 

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {

// Implement email action here
gs.include('validators');

if (current.getTableName() == "sn_hr_core_case") {
var gr = current;
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;

if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;

if (gr.state == 6) {
gr.state = 18; // In Progress
}
gr.update();
}

})(current, event, email, logger, classifier);



1 REPLY 1

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@mdshahvez11 This is most likely due to the QBR that restricts people that are not the Opened for, Subject person or are not on the watch list. The replies look at the sender to see if they have access to the case in order to update it. This post gives additional insight on how to address this.

If my answer has helped with your question, please mark my answer as an accepted solution and give a thumbs up.

Regards,

Mike