Inbound Action Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2015 10:27 AM
Using Eureka
I am trying to craft an inbound action script to scrub the body of an inbound email and create an incident with the desired fields populated and routed to the appropriate groups.
Below is the inbound email; body starts on line 6:
From: Reports Issues [mailto:contoso@contoso.com]
Sent: Wednesday, October 28, 2015 12:43 PM
To: <person@contoso.com
Subject: Import Banner IssueIssueId: 4221
Priority: 3 - Moderate
State: Work In Progress
Product: Banner
ConfigurationItem: Banner
AssignmentGroup: Banner Financial Aid
AssignedTo: Person Assigned
AssignedToEmail: person1@contoso.com
IssueOwner: Tess Passey
IssueOwnerEmail: person2@contoso.com
ShortDescription: Self-service - implement Web Snapshot
Description: want to look into implementing Web Snapshot. should be a part of FA Self-Service release 8.12.
DateCreated: 01/06/2012
This is the inbound action I have created thus far, but I don't think I am interpreting the wiki info to route these correctly:
- current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
- current.short_description = email.subject;
- current.incident_state = 1;
- current.notify = 2;
- current.contact_type = "email";
- current.caller_id = gs.getUserID();
if(email.body.configurationitem != undefined) {
current.tsnoc = email.body.configurationitem;
}
if(email.body.assignmentgroup != undefined) {
current.d7bc71eec5a2c900fadf7cf8915b2ea0 = email.body.assignmentgroup;
}
if(email.body.assignedto != undefined) {
current.d4dece082b9501001e1c5dd417da15e1 = email.body.assignedto;
}
- current.insert();
- event.state="stop_processing";
I already have some basic IA's working, but those do not get much more detailed than the basics:
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.incident_state = 1;
current.notify = 2;
current.contact_type = "email";
current.caller_id = gs.getUserID();
current.assignment_group = 'f8657087492ab1001e1ca684059595bc';
current.insert();
event.state="stop_processing";
For the 'if' statements, they are not reading properly and thus not designating the appropriate fields in a new incident. Any insight is appreciated!
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2015 01:19 PM
Not sure I understand your comment because I have populated many ref fields such as Assignment Group, Assigned To even the Watchlist field using inbound actions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2015 03:18 PM
I am wondering if this is the issue. Makes it look like the inbound email must be in plain text from the source.
Will try it later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2015 06:23 PM
you can try something like
current.assigned_to.setDisplayValue(email.body.assignedto);
That should set the value based on the name. The problem there is that the first John Smith in the list will be the assigned_to value.
-Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 07:54 AM
Thanks, Chris
This was also helpful. Allowed me to use the names instead of sys_ids.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2016 01:13 PM
I have a similar issue to Nick's.
Here is my script:
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
}
if (email.body.priority != undefined)
current.priority = email.body.priority;
if (email.body.category != undefined)
current.category = email.body.category;
if (email.body.sub != undefined)
current.subcategory = email.body.sub;
if (email.body.desc != undefined)
current.work_notes = email.body.desc;
if (email.body.impact != undefined)
current.impact = email.body.impact;
if (email.body.urgency != undefined)
current.urgency = email.body.urgency;
if (email.body.group != undefined)
current.assignment_group = email.body.group;
if (email.body.assignee != undefined)
current.assigned_to = email.body.assignee;
current.insert();
event.state="stop_processing";
Email is:
Subject: [whatever you want it to be]
Content:
Requestor: Joe User
Category: Infrastructure
Sub: Network
Impact: 1
Urgency: 1
Group: Infrastructure
Assignee: Joleen Technician
Desc: Critical: node down triggered for Seattle 20th floor Switch 4
I can get the script to interpret/populate everything but the Assignment Group. Not sure why I can't get that to work...I've looked at assignment rules, dictionary, field settings, business rules. Anybody have an idea?