- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2014 02:29 AM
Hi
Using an inbound action I am trying to populate the short description with a line from the inbound email but my attempts have failed (again) I have tried using a script provided previously to be used in a record producer however thats failed. The email body will have the following lines, I want to pull the answers and add them to the short description stating New starter request for.....
First Name
Last Name
Any help would be greatly appreciated.
Regards
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2014 05:22 PM
Have you tired using email.body.first_name (in lower case not upper case)
I think they may change the variables to all lower case when setting up the inbound integration.
Cheers,
Cameron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2014 03:26 AM
so if I remove the space between First and Name the sytnax is fine however the line on the email is First space Name. This still does not populate the short description.
On another note, this inbound action was intially built on the incident table, I change it the Request (Sc_Request) and when processing emails it does not check through the email actions. the email log shows the recieved email line (Received new email with UID: 0000012c5182a7a7) but nothing after that, is there a reason inbound actions will not map to the request table?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2014 03:40 AM
Hi,
Thaks again for input all,
its still not populating the description with first name. Below is my current if statement and below that I have included the body of the email that its pulling from, I am sure its sopmething quite simple now (a space or something its not expecting)
current.u_type = 'Request';
current.caller_id = GetIDValue('sys_user', 'New-Starter-Process');
current.u_category_level_1 = GetIDValue('cmdb_ci', 'Domain');
current.u_category_level_2 = GetIDValue('cmdb_ci', 'Access');
current.u_category = GetIDValue('u_category_lookup', 'Service Request');
current.priority = '9';
current.contact_type = 'email';
current.assignment_group = GetIDValue('sys_user_group', 'System Admin');
current.assigned_to = '';
current.opened_by = GetIDValue('sys_user', 'New-Starter-Process');
if(email.body.FirstName != undefined) {
current.short_description = email.body.FirstName;
}
current.insert();
Body of the email the if statement is looking at
A new starter request has been submitted. Please find the details below :
Timestamp :
Username :
First Name : Steve
Last Name :
Role Title :
HR or MRA Reference No.* :
First Name :
Last Name : ;
New Role Title :
Department Name or RAD :
Base Office :
Start Date :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2014 04:02 AM
are you able to change the body of the email from First Name to First_Name?
then change your code to:
if(email.body.First_Name != undefined) {
current.short_description = email.body.First_Name;
}
As the others said, javascript really doesn't like spaces when it's looking for specific values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2014 04:20 AM
Hi,
Thanks for the response. So I have made the changes to the script and to the inbound email to change the space to a _ (I have also tried FirstName with no space) and still the short description is blank. My script is below. If anyone can spot an obvious error please let me know.
if(email.body.FirstName != undefined) {
current.short_description = email.body.First_Name ;
}
current.insert();
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2014 05:45 AM
Is it FirstName or First_Name because on both lines you have it different. Correct that to the correct parse value and you should be good.
Marc