Emails not processed

radt
Kilo Guru

Hello, we have 4 emails sent from mailbox to service now. they are gone from mailbox and only the first one is processed and created a case.. remaining 3 are not sent to service now emails nor created a case. Is there anything that service now is set a filter to block duplicate emails sent?  As 4 of the emails are same and we wanted this to create 4 emails but only first one is processed. Anything in inbound actions or what is it blocked service now to receive the remaining 3 emails?

 

@Ankur Bawiskar 

 

TIA 🙂

3 REPLIES 3

Mark Manders
Mega Patron

Check your inbox, received and junk to see if they are there or not. It could be that they were moved to junk as duplicates, but then the reason should be displayed. If they aren't there, you need to check with your IT to see what happened, because SN will keep all emails it receives.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

We have 6 emails sent from mailbox to service now with same details and subject. I see only 1st one created a case and remaining 5 are not even visible in service now emails. When we contacted service now they mentioned a BR is doing this and ignoring the duplicates. I didn't understand how this is customized as this was done previously from different team. Can some one explain what it is and how can I fix our issue in changing this BR? I partially understood that it is taking some time interval to see if same email comes in this interval ignore it.. something like that.. I am not sure whether I am correct .. please let me know your thoughts.

 

Br:

 

(function executeRule(current, previous /*null when async*/) {

var secondsAgo = 30;
var message_id = current.headers;

gs.info("Message ID  is"+ message_id);

var findID = message_id.indexOf("Thread-Index:");
var initSub = message_id.substring(findID);
var subID = initSub.substring(13, 45);
gs.info("Thread Index is"+ subID);

// var sTime = new GlideDateTime(current.sys_created_on);
// gs.info("Current Time of Creation of email is"+ sTime);
// var eTime = sTime.subtract(3000);
// var EndTime = new GlideDateTime(eTime);
// gs.info("End Time iss"+ EndTime);

// //ar endTime = new GlideDateTime(eTime);
// gs.info("End Time is"+ eTime);

var sTime = new GlideDateTime(current.sys_created_on);
var start = sTime.getNumericValue();
sTime.subtract(5000);
var EndDate = sTime.getValue();
var end = sTime.getNumericValue();
gs.info("Start time is"+ start + "&& End Time is"+ end);
var sDate = new GlideDateTime(start);
var eDate = new GlideDateTime(end);
gs.info("Current Date"+ current.sys_created_on+ "&& End Date"+ EndDate);

var semail = new GlideRecord('sys_email');
// semail.addEncodedQuery('sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)');\
//semail.addEncodedQuery('sys_created_onONCurrent minute@javascript:gs.beginningOfCurrentMinute()@javascript:gs.endOfCurrentMinute()');
//semail.addEncodedQuery("sys_created_onBETWEEN" + current.sys_created_on + "@" + EndDate);

// semail.addEncodedQuery('sys_created_onBETWEENjavascript:gs.dateGenerate(EndDate)@javascript:gs.dateGenerate(current.sys_created_on)');
semail.addQuery("sys_created_on",">=",EndDate);

semail.query();
gs.info(semail.getEncodedQuery());
while(semail.next()){

var eheader = semail.headers;
var eid = eheader.indexOf("Thread-Index:");
var initSub1 = eheader.substring(eid);
var subID1 = initSub1.substring(13, 45);
gs.info("Existing Thread Index is"+ subID1);

// if(subID1 == subID && current.headers != ""){

// gs.info("Testing Ignore!!!");
// // current.type = 'received-ignored';
// // current.update();
// current.setAbortAction(true);

// }
if(current.user == semail.user && current.recipients == semail.recipients && current.subject == semail.subject && current.headers != ""){

gs.info("Testing Ignore1!!!");
current.setAbortAction(true);

}
}

})(current, previous);

Great.. you inherited a business rule including all logging and this is on PROD? At least get rid of the 'Testing Ignore' comments.

But why not deactivate this and just use inbound actions? If no one knows why this BR is there, only 2 things can happen: you find out why it was there and create a working solution, or nobody notices anything and you have a working inbound email.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark