I am trying to use a condition of email.subject.contains ("xxxx") on an inboud email action but it doesn't work

donna_mcclung
Kilo Contributor

I can get an inbound action to work with email.subject.startsWith("Single - ") but not contains. I am on Fuji release.

7 REPLIES 7

Michael Fry1
Kilo Patron

You will have to use indexOf. Something like this:



email.subject.toLowerCase().indexOf("single - ") >= 0


Hi Michael,

 

Can you please suggest me the code?

 

Example: If the word HOT is in the Body Text, I need a HOT ticket to be created, but if someone puts HOTEL, I want to avoid a HOT ticket being created.

Nate23
Mega Guru

try


if((email.subject.indexOf('put what u want here') != -1)



if the subject is not found it will return -1


confused as to what I actually put in the field, where will it return a 0 or a 1.   this is a field called condition.   not the script field