- 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:52 AM
Its client callable and the subject of email contains INC so have put email.subject.xx

- 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 05:28 AM
Aah! yes makes sense . Working with
var str = email.toString();
Thanks for pointing out the logic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 10:02 AM
Also the SI returns true OR False and how do I get the 'incnum' (Incident number) in inbound actions calling this SI in inbound actions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 10:09 AM
You could add a new function to your script include or write the following in your inbound action:
regex = new SNC.Regex('/INC\\d{7}/im');
var a = regex.match(email.subject.toString())[0];