- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Incoming emails are the emails sent to the instance. The inbound emails are classified by following an algorithm as New, Reply or Forward. Inbound email actions enable an administrator to define the actions ServiceNow takes when receiving emails. The feature itself offers a superb level for scripting and a well balanced design for the classified emails, saves you time on coding and guarantee a clear understanding to expand and keep your email actions up to date.
Inbound email action 'Type' field offers flexibility to the user with the ability to be set to None that matches all incoming emails. The 'Target table' field offers a similar feature. Those options are well positioned the top of the incoming action form so pay attention when setting them. Here are two tests I did to experiment with None matching all incoming emails on incoming email options 'Type' and 'Target table.'
Incoming email options 'Type' and 'Target table.'
The 'Target table' selects the table where the action will be added or records updated. The 'Type' selects the message type required to run the action. The action runs only if the inbound email is of the selected type. Setting the inbound action type to None, increases the complexity as the rule matches all incoming email received types. This could be of advantage on may designs. e.g. if you are using them to stop certain executions based on conditions regardless of their type.
'Type' set to None matches all incoming emails
Testing the inbound actions with Type set to None
I have created an inbound email action as follow:
Inbound Email action | ||
Name | = | test_type_none |
Target table | = | Incident |
Type | = | None |
Condition | = | email.subject && (email.subject.match(/\b(?:spam|loan|winning|bulk email|mortgage|free)\b/i) != null) |
Order | = | 10 |
Script =
gs.log('CS - test_type_none start'); // dev only - remove on prod
// No further inbound actions are required - stopping them
sys_email.error_string += 'processing stopped by test_type_none by subject keyword: '
+ email.subject.match(/\b(?:spam|loan|winning|bulk email|mortgage|free)\b/i) + '\n';
event.state="stop_processing";
gs.log('CS - test_type_none ends'); // dev only - remove on prod
Then I have sent 3 emails with subject "... freeware offer" classified as new, reply and forward each.
Also I have sent 3 emails with subject "... free " classified as new, reply and forward each.
Results: All incoming emails are processed as expected by the incoming action. As per condition, some processing is bypassed.
Testing the inbound actions with 'Target table' set to None
I have created the following inbound action:
Inbound Email action | ||
Name | = | test_target_table_none |
Target table | = | None |
Type | = | None |
Condition | = | (empty) |
Script:
gs.log('CS -test_target_table_none start'); // dev only - remove on prod
event.state="stop_processing";
gs.log('CS - test_target_table_none ends'); // dev only - remove on prod
Then I have sent 3 emails that classify as new, reply and forward.
Results: Setting Target table to None, it will not execute the inbound action correctly.
If Target table set to None the followings are the results of incoming emails :
Incoming emails | |||
Classified as | Target | Notes | Usual logs if there is no update |
New | (empty) | Always error | Error while classifying message. org.mozilla.javascript.EvaluatorException: GlideRecord.setTableName - empty table name (<refname>; line 1) |
Reply | (empty) | Always skipped | watermark's target table '<found-table-by-watermark>' does not match any Inbound Action table, setting to 'Ignored' state |
Forward | (empty) | Always error | Error while classifying message. org.mozilla.javascript.EvaluatorException: GlideRecord.setTableName - empty table name (<refname>; line 1) |
I advise that you always double check and make sure to select your Target table correctly and only set your Type appropriately to match the correct classified emails. Just because you have the option, does not mean you need to use it. Plan and validate.
I have tested this with Fuji and Chrome as the browser.
More information here:
- 8,328 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.