Inbound email - how do i ignore an email so it doesnt create an incident

paulbrinkman
Kilo Explorer

good afternoon all

I am looking to ignore certain emails that are currently creating incidents within ServiceNow.

I have the default OOTB script running on my DEV system, I have tried various things to ignore certain emails, nothing seems to be working.

What am i doing wrong ?

Kind regards
Paul

9 REPLIES 9

hi Chuck,



I want to ignore incidents being created for either phrases or certain words within the short description or incident message body.



For example, something like below.



"CLEAR (DC1): Link was in high load, but has now returned to normal operation"



I dont need incidents raised for things like above.   But looking through the inbound email actions documentation, it doesn't seem very straight forward how to ignore these ?



many thank
Paul


Ok, so you might have to add condition in Inbound actions to check for keywords in subject line. For instance, for your subject line:



!(email.subject.indexOf("CLEAR") >= 0)



Or in the code, before the insert() action,   you can check for keyword from subject or body.


If the content is in the email body then you should use "email.body". You can update the Condition field or direct it to a script include for better control.



Condition: (!email.body.short_description.toString().indexOf("CLEAR (DC1): Link was in high load, but has now returned to normal operation") >= 0)



Or


Using a script include to call a function



function validateEmail(){


if(email.body.short_description.toString().indexOf("CLEAR (DC1): Link was in high load, but has now returned to normal operation") >= 0)


return true;


}else{


return false;


}


paulbrinkman
Kilo Explorer

hi Alikutty,



Thanks for the feedback, so to be clear, if i use the "when to run" gui option, if i wanted to ignore something within the email body i should put in something like this



find_real_file.png


Yes, You can add condition like Body does not contain 'text to search' to ignore the inbound action for that particular email.




Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response