Inbound Email Action

tulasi8
Tera Contributor

Hi Community,

 

This was the inbound email action written in servicenow for ritm creation:
 
if(email.to.toLowerCase().indexOf("oracle.hris.cloudsupport@ajg.com")>= 0 || email.to.toLowerCase().indexOf("oracle.hris.projectsupport@ajg.com")>= 0 || email.to.toLowerCase().indexOf("oracle.hris.integrationsupport@ajg.com")>= 0 || email.from.toLowerCase().indexOf("no-reply@oracle.com")>= 0 && email.subject.toLowerCase().indexOf("unplanned outage - resolved for arthur j gallagher and co: hcm1574571822583 production, cloud account ehzo")>= 0 || email.from.toLowerCase().indexOf("no-reply@oracle.com")>= 0 && email.subject.toLowerCase().indexOf("announcement: unplanned outage extended for arthur j gallagher and co: hcm1574571822583 production, cloud account ehzo")>= 0){
var user = new GlideRecord('sys_user');
user.addQuery('sys_domain',gs.getProperty('AJGDomainSysID')); //AJG Domain ID
var mail = user.addQuery('email',email.origemail);
user.query();
 
if(user.next()){
//gs.log('Forward Inbound triggered'+user.getRowCount());
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('f8a02a8cdb776b04a8a37dfdae9619b9');// Oracle Cloud Support Operations
var pri= 3;
// Fill Out the Cart Variable Values
var grpName =gs.getProperty('AJGHRcloudsupportID'); // Sys_id of myHR Support
var grpName2 =gs.getProperty('AJGHRcloudprojectID');
var grpName4 =gs.getProperty('AJGHRISCCI');
var grpName5 =gs.getProperty('AJGUnplannedOracle');
 
if(email.to.toLowerCase().indexOf("oracle.hris.cloudsupport@ajg.com")>= 0)
{
 
cart.setVariable(item, 'v_assignment_group', grpName);
cart.setVariable(item, 'v_assignment_group2', 'Oracle Cloud Operations Support' );
cart.setVariable(item, 'v_area', 'Oracle Cloud Operations Support');
cart.setVariable(item, 'v_requested_by', gs.getUserID());
cart.setVariable(item, 'v_short_description', email.subject);
cart.setVariable(item, 'v_description', email.body_text);
cart.setVariable(item, 'v_watch_list', email.copied);
cart.setVariable(item, 'v_legislation', 'United States');
}
// On RITM Table
 
var ritmSysID = "";
 
var ritmRec = new GlideRecord("sc_req_item");
ritmRec.addQuery("request", rc.sys_id);
ritmRec.query();
 
if(ritmRec.next())
{
// gs.log('ritmRec:' +ritmRec.number);
ritmSysID = ritmRec.sys_id;
ritmRec.u_location = loc;
}
 
}
One of the user sent mail to "oracle hris cloud support" for ritm creation through inbound email action  :
tulasi8_0-1784724917341.png


Mail triggered to the group , but the ritm was not created . So i checked in email logs, from there its showing logs like "Skipping script 'RITM Creation -AJG', email is type 'reply', which does not match Inbound Email Action's type 'new'".

 

How can ServiceNow is considering this email as reply instead of new . Can anyone please help on this. @Ankur Bawiskar 

 

Regards,

Tulasi.

7 REPLIES 7

Tanushree Maiti
Tera Patron

Hi @tulasi8 

 

Refer KB: KB0535515 Inbound Email Action Type is not Matched 

 

Resolution

Troubleshooting

  1. Open the email record.
  2. Right-click the form header to change the view to Inbox.
  3. Review the related log entries. These identify a reason an Inbound Action was skipped. 

Troubleshooting Reply Inbound Actions

As shown in the article in the overview, an email is classified as a reply only if it matches multiple criteria. If your inbound action of type Reply is not matching on an email you expect it to, it is possible your ServiceNow instance has actually classifiied the email as New or Forward because other Reply conditions do not exist in the email. To diagnose, check the following:

  1. Open the email record in the Inbox view and review the log entries.
  2. Check that the email subject's reply prefix is one of those listed in the glide property, glide.email.reply_subject_prefix.
  3. If the email has a watermark (for example, Ref:MSG000001), check that it exists and refers to a record that exists in the same table as your Inbound Action's target table.
  4. If the email has a record number in the subject, check that it exists and is in the same table as your Inbound Action's target table.

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

@Tanushree Maiti can you please send the entire kb info here, i can't able to open kb article

yashkamde
Giga Sage

Hello @tulasi8 ,

 

As per my understanding try fixing the inbound email action to handle both new and reply types. That way, whether the user sends a fresh email or replies to an Oracle notification, the RITM creation logic will still execute.

 

If my response helped mark as helpful and accept the solution.