Inbound Email Action not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 07:37 AM
In a new application I have created I have enabled email sending and am showing sent/received email in activities however whilst I can see outbound email I cannot see inbound so I checked 'System Mailboxes - Received' and saw it wasn't being processed. My inbound action on the correct table is as below:-
gs.include('validators');
if (current.getTableName() == "u_wmi_change_europe") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
}
current.update();
}
Above is the inbound action
TIA
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 07:42 AM
Hi Angus,
Have you checked out this series of videos? It includes one on debugging. Inbound Email - YouTube
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2016 07:10 AM
Thanks for the input I had already checked those out but they didn't help at all I'm afraid.
I have played around with this too much now, below is my latest business rule set in the inbound action - I just can't work out why it doesn't process #frustrated:-
gs.include('validators');
if (current.getTableName() == "u_wmi_change_europe") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
if (email.body.category != undefined)
current.category = email.body.category;
if (email.body.short_description != undefined)
current.short_description = email.body.short_description;
current.update();
}
I've also checked the new table doesn't extend any other table just to be sure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2016 07:34 AM
What does the actual email look like? I noticed that you selected: type = reply. In my experience, the default ServiceNow reply prefixes do not match actual enterprise mail client's reply prefixes (Outlook, Google, etc.).
http://wiki.servicenow.com/?title=Inbound_Email_Actions#Specifying_Recognized_Reply_Prefixes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2016 07:55 AM
Robert I checked the reply and it was prefixed with RE so I double checked the system property glide.email.reply_subject_prefix and it already had re so just to double check I added RE and I also added to the inbound action it now has a new second line:-
gs.include('validators');
email.subject.startsWith("RE:")
if (current.getTableName() == "u_wmi_change_europe") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
if (email.body.category != undefined)
current.category = email.body.category;
if (email.body.short_description != undefined)
current.short_description = email.body.short_description;
current.update();
}
Interestingly I have noticed that on the received email the target field is empty - see below
Does a table have to be registered somewhere for this to work? If so I can't find anything in the WIKI/Product documentation
Thanks