- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 11:43 PM
Hi,
I have a issue when I am trying to find a particular string in email.subject so I have used following in the inbound email action but none of them worked.
if(email.subject.toLowerCase().indexOf("INC") > -1)
{
current.u_escalation_type='Incident';
}
AND this is another way I tried
var subject=email.subject.toLowerCase().toString();
if(subject=="INC")
{
current.u_escalation_type='Incident';
}
None of them worked. Please guide me how I can achieve this.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 11:55 PM
Hi,
if(email.subject.toLowerCase().indexOf("INC") > -1)
Should work. Can you apply logs & see if it goes in IF statement.
Something as below.
if(email.subject.toLowerCase().indexOf("INC") > -1)
{
gs.log('Inside if statement');
current.u_escalation_type='Incident';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2022 11:55 PM
Hi,
if(email.subject.toLowerCase().indexOf("INC") > -1)
Should work. Can you apply logs & see if it goes in IF statement.
Something as below.
if(email.subject.toLowerCase().indexOf("INC") > -1)
{
gs.log('Inside if statement');
current.u_escalation_type='Incident';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2022 12:01 AM
Hello,
Try the below code.
if(email.subject.toLowerCase().indexOf("inc") > -1)
{
current.u_escalation_type='Incident';
}
OR
if(email.subject.contains("INC"))
{
current.u_escalation_type='Incident';
}
Thanks,
Namrata