Condition for Inbound Action(e-mail)

Bhawana Tomar
Tera Contributor

If I a not giving any condition in When to run section,  and directly giving condition in script, it is still creating an incident.

 

I want to put condition if email is not from particular domain, incident should be created . How can i check this condition in When to run section only?

1 ACCEPTED SOLUTION

Hi @Bhawana Tomar ,

 

You can use email filters to ignore the emails

Email filters

you can also block it based on the domain

Block emails from domains

You can also use the condition field in the Inbound email action

Ignore if the email came from gmail.com

email.from.indexOf("@gmail") == -1

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

View solution in original post

4 REPLIES 4

Sumanth16
Kilo Patron

Hi @Bhawana Tomar ,

In the inbound action, you can add below condition to exclude emails from other domains

if (email.origemail.indexOf('@calstate.edu')>-1)//update with your email id 

{

return false;

}

(or)

 

Please refer to below thread:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0659203

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

Hi @Sumanth16 

It is throwing javascript parse error

Screenshot 2024-03-16 222209.png

 

Hi @Bhawana Tomar ,

 

You can use email filters to ignore the emails

Email filters

you can also block it based on the domain

Block emails from domains

You can also use the condition field in the Inbound email action

Ignore if the email came from gmail.com

email.from.indexOf("@gmail") == -1

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Bhawana Tomar ,

 

Seem like you want to restrict certain domains from creating incidents. to do so you can allow only certain domain to process inbound using system property.

 

go to inbound email properties from navigator and from available properties of inbound enter the domain on which you want to allow the inbounds to be created.

 

i hope this helps..


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect