
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2017 07:33 PM
I am trying to pull "name" and "group" from an inbound email that gets send from another ticketing system. User ID would be the caller and group is the assignment group. Please see below on the code. I am pulling "User ID" to get the name of the caller. And pulling "Current Assignees:" for assignment group. Currently it is coming out as guest as caller.
var userIdWithExtraChars = bodyVariable.substring(bodyVariable.lastIndexOf(") by") + 11, bodyVariable.lastIndexOf(") by") + 41);
current.caller_id = email.body.user_name;
if (email.body.assignees != undefined)
current.assignment_group.setDisplayValue(email.body.assignees);
Here is the email:
Body
Notification of Work Order Registration
Work Order: | PC Not Working |
Work Order Number: | 79032 |
Additional Comments:
Entered on 10/27/2017 at 20:29:54 PDT (GMT-0700) by Jane Brown
The PC is not working and is plugged in.
Current Assignees: Desktop Support
Customer Information:
User ID: | smithj |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2017 01:42 PM
Hi Bryant ,
Did you try:
current.caller_id.setDisplayValue(email.body.user_id);
By the way, I have not had luck using spaces in the email body, so for example, "User ID" did not work, but "user_id" did.
In your email, you have User ID with a space.
harel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 04:35 PM
This one worked with some tweaking thanks.
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.description = email.body_text;
current.category = "request";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
if (email.body.user_id != undefined)
current.caller_id.setDisplayValue(email.body.user_id);
if (email.body.assignees != undefined)
current.assignment_group.setDisplayValue(email.body.assignees);
if (email.body.state != undefined)
current.state = 6;
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
current.insert();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2017 12:51 AM
can we try like,
current.caller_id = email.body_text.user_id;
current.assignment_group.setDisplayValue(email.body_text.current_assignees);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 04:25 PM
Still not working. I also tried below. I am more concerned about the user id.
// Note: current.opened_by is already set to the first UserID that matches the From: email address
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.description = email.body_text;
current.category = "request";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
if (email.body_text.user_id != undefined)
current.caller_id = email.body_text.user_id;
if (email.body.assignees != undefined)
current.assignment_group.setDisplayValue(email.body.assignees);
if (email.body.state != undefined)
current.state = 6;
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
current.insert();
}