inbound action not working

tGhadage
Tera Contributor

Hi Guys, 

 

here is my inbound action: 

if (email.subject.contains("Critical") && email.recipients.toLowerCase().indexOf("test@test.com") > -1) {
            current.impact = 3;
            current.urgency = 3;
            current.priority = 3;
            current.short_description = email.subject;
            current.insert();
        } 
where I am creating incident with this info when the email address is from that id and if the subject contains
' critical'.
 
but it is creating incidents for short description other than critical also. 
 
Can you please guide!! 
Thanks!
3 REPLIES 3

Amitoj Wadhera
Kilo Sage

Hi @tGhadage  ,

 

Corrected Script:

if (email.subject.toLowerCase().indexOf("critical") > -1 && email.recipients.toLowerCase().indexOf("test@test.com") > -1) {
    current.impact = 3;
    current.urgency = 3;
    current.priority = 3;
    current.short_description = email.subject;
    current.insert();
} 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

So here incoming email address is presented as a recipient. 

its still creating the incident for the subject " clear ".

Screenshot (200).png