- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 12:08 PM
Hi all,
This might be a bit basic, but I can't get it to work:
I am trying to tell the inbound action to skip creating an incident if the body of the email contains the word "CLEARED: ".
I am trying something like this:
...
} else if (email.recipients.indexOf('monitoring.network@MyCompany.com') > -1) {
if(email.body.indexOf("CLEARED: ") > -1) {
current.setAbortAction(true);
}
createIncidentNetwork();
gs.log('HBS, createNetworkIncident');
}
Using if(!email.body.indexOf("CLEARED: ") > -1) yields: confusing use of !
How do I tell the script to stop running?
How do I fix this if condition?
Thanks,
Harel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:05 AM
Hi,
I would try adding an email filter instead of using the inbound action.
The Email Filter plugin must be activated to work.
Create a new Filter and add the condition "Body contains cleared: "
Under filter actions you can mark is as ignored or junk (for testing I use junk)
Hope this helped.
Darla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:18 AM
Hi Darlene,
I am trying this now. Thanks!
Although the plugin is quite an elegant solution, I'd still want to try and work it out with a script, though.
Harel