Lower case issue in inbound action

Hafsa1
Mega Sage

I have a "reply" inbound action for custom payroll table which treats "re:" emails as new if ticket number is provided in subject. We are not using watermark for this actions.

Whenever user send email with payroll ticket number in subject in lower case new ticket is not getting created but when sent in uppercase it creates.

like:  if user send email with subject as in case 1 tickets are created but when he send as case 2, tickets are not getting created. No error in log file it just say "skipping as condition not met"

condition is : email.subject.toLowerCase().indexOf("pylt")>-1

 I tried condition as below but nothing works:-

email.subject.toLowerCase().indexOf("pylt")>-1

email.subject.toUpperCase().indexOf("PYLT")>-1

email.subject.toLowerCase().indexOf("pylt")>-1 || email.subject.toUpperCase().indexOf("PYLT")>-1

case 1:  "Issue in payroll wrt ticket number PYLT1000890. please resolve the issue"

case 2: "Issue in payroll wrt ticket number pylt1000890. please resolve the issue"

 

 

Where can be the issue

 

9 REPLIES 9

Manish Vinayak1
Tera Guru

Try typecasting the email.subject variable:

String(email.subject).toLowerCase().indexOf("pylt")>-1
//OR
String(email.subject).toUpperCase().indexOf("PYLT")>-1

Vishal Khandve
Kilo Sage

Hi Hafsa,

 

Try replacing >=0 with -1 something as below

email.subject.toLowerCase().indexOf("text") >= 0


Thanks,
vishal

Hafsa1
Mega Sage

tried all below but not creating. When I give in uppercase then only it's creating case.

 

email.subject.toLowerCase().indexOf("pylt") >= 0
String(email.subject).toLowerCase().indexOf("pylt")>-1
//OR
String(email.subject).toUpperCase().indexOf("PYLT")>-1

check if is there any other condition