- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2024 11:01 AM
I have done a lot of research and been not lucky to find a solution.
Here is the is situation. We use inbound actions on multiple email addresses to be forwarded to ServiceNow and assigned directly to an assignment group based on the email address. When someone forwards the email to the email address. the script cannot understand the FW in the short description and defaults to our primary process which is to the Help Desk assignment group. Everything i have read says this is something ServiceNow cannot understand or read and will default to main scripting or email ingestion. Note this is not updating existing incidents its creating new.
The inbound action has the settings below
Target table: incident
Action type: Record Action
When to Run
To is "insert email address."
The script of creation of incident is below
// Note: current.opened_by is already set to the first UserID that matches the From: email address
// email will be changed to MT.SAPsupport@itt.com will be changed to this when live
var user = gs.getUserID();
var user1 = gs.getUser();
current.caller_id = user;
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
//current.category = "request";
current.incident_state = 1;
//current.notify = 2;
current.contact_type = "email";
current.u_service_group = 'concur';
current.u_request_type_ = "Request";
current.assignment_group.setDisplayValue("Concur");
current.location = user1.location;
current.impact = 4;
current.urgency = 3;
current.insert();
event.state="stop_processing";
_____________________________________________
Any ideas on this would be helpful as we are trying to reduce the time of tickets sitting in the main help desk queue and get directly to the support group for that issue.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2024 07:44 PM - edited ‎07-18-2024 07:45 PM
It takes a great deal of luck to get an Inbound Action working right in the first attempt😉
While its hard to figure out what went wrong without seeing the thing execute first-hand, here are some guidelines/tips for you:
1. Please remove the last line in the script. If you want to stop processing further inbound actions, then set the Stop processing checkbox to true
event.state="stop_processing";
2. Check if you have the Type field set to Forward
3. Check your received mail logs (related list). It holds important info such as which inbound action was processed, and why your inbound action was skipped. If your inbound action was processed, then the message would say why incident could not be created.
4. Remove the conditions on your inbound action and run a test, to rule out faulty conditions
5. Look for other inbound actions on the same table as yours, and try lowering the order of your inbound action so it executes before everything else.
6. Try making your script simpler by commenting out dynamic code and using hardcoded values, to rule out script related issues.
7. Simplify the script even further by only setting mandatory field values.
8. Ensure the script is setting values on all the mandatory fields (System may not have inserted the record due to missing mandatory data)
Try these and see if something happens.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2024 07:44 PM - edited ‎07-18-2024 07:45 PM
It takes a great deal of luck to get an Inbound Action working right in the first attempt😉
While its hard to figure out what went wrong without seeing the thing execute first-hand, here are some guidelines/tips for you:
1. Please remove the last line in the script. If you want to stop processing further inbound actions, then set the Stop processing checkbox to true
event.state="stop_processing";
2. Check if you have the Type field set to Forward
3. Check your received mail logs (related list). It holds important info such as which inbound action was processed, and why your inbound action was skipped. If your inbound action was processed, then the message would say why incident could not be created.
4. Remove the conditions on your inbound action and run a test, to rule out faulty conditions
5. Look for other inbound actions on the same table as yours, and try lowering the order of your inbound action so it executes before everything else.
6. Try making your script simpler by commenting out dynamic code and using hardcoded values, to rule out script related issues.
7. Simplify the script even further by only setting mandatory field values.
8. Ensure the script is setting values on all the mandatory fields (System may not have inserted the record due to missing mandatory data)
Try these and see if something happens.