- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:06 AM
Hi Experts,
I want to add extra condition to check in my inbound action whether the email subject contains INCIDENT or not . There are many places where I need to check this so thought of putting it in script include and calling it in condition but it is not executing SI . SI has prototype.
Want to execute when email subject does not contains any INCIDENT
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:18 AM
Hi,
Have you validated that the SI is being called?
Also your script is incorrect. you're passing email.subject as the email variable however you're then doing:
var str = email.subject.toString();
This is effectively
var str = email.subject.subject.toString();
change it to var str = email.toString();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:15 AM
Hi,
Is your SI being called? add a log in the 1st line and check.
If its being called, then while passing, pas it like this
email.subject.toString()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:53 AM
Yes ClientUtils is the SI name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:58 AM
Did you add a log in the 1st line of your function and checked?
OR go to background scripts and test like this
gs.print(new ClientUtils().checkEmailSubjectForIncident("My subject"));

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:18 AM
Hi,
Is this script include server side or client side?
Also there is one error. You are passing email.subject in that condition builder and agian in script include you are doing email.subject which is wrong.
you just have to put var str = email.toString() in script include instead of var str = email.subject.toString()
Thanks,
Ashutosh