How to update a case via inbound email action which is not a servicenow generated email

sukku
Tera Contributor

Hi All,

We have a requirement like when we send an email from our outlook to the xyz shared email box then this shared email box will forward that email to our servicenow instance. Once a email is received from that shared mailbox it should create a case. This scenario is happening exactly as expected.

But when I click on reply all on top of previous email in my outlook it should update a work notes of the same case with email body. For this i have configured inbound email action with type as reply and conditions and in actions i have given work notes set as email body. This scenario is working fine in some case and it is creating new case in some other scenarios. Without watermark how it is classifying as reply and updating a case which is not servicenow generated emails.

If i want to achieve this reply email to update case with out any issue could someone provide me help on this.

Thanks

2 REPLIES 2

abhijitkhewale
Mega Expert

Go through below link, better check with subject line

 

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/notification/reference/r_InboundActionTypeCriteria.html

 

 

Hi abhijitkhewale,

I have written below function in script include and calling this script include in the condition field of inbound email action.

script include:

passesEmailConditions : function(email){

var answer = true;

var gr = new GlideRecord('sn_customerservice_case');

gr.addQuery('short_description', email.subject);

gr.query();

if (gr.next())
{
gs.info(gr.number + ' is a duplicate issue of: ' + email.subject);
gs.info(gr.short_description);

gr.work_notes = 'Alert Triggered Again: ' + email.subject + email.body_text;

gr.update();

answer = false;

 Inbound email action:

condition:new  x_eyct_cyber.Inboundcyberemailutils().passesEmailConditions(email);

It is updating a case when i wait for one reply to process and send it again.

 

If i first send a fresh email to this shared mailbox and again sending reply email ton top of that the again i have sent multiple replies. Then it is creating a new case for some replies and for some replies it is updating a case.

 

This is the problem i am facing.

Thanks