Inbound email action not writing email body to comment field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 10:55 AM
Hi all,
I want to allow a user to reply to an email notification and write the reply back to the Comments field on my custom application table; just like Incidents does. I've got the inbound email action written and it is being processed. However, the reply contents are not being saved to the Comments field like they do with Incidents.
If I expose the "Emails - autogenerated" or "Emails - correspondence" options on the activity feed, I can see the reply that was sent...along with the entirety of the email. Not what I want.
The code of my email action is about as simple as it can be:
(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
current.comments = "Reply from: " + email.origemail + "\n\n" + email.body_text;
current.update();
})(current, event, email, logger, classifier);
I've checked the logs for the email and I get the ubiquitous: "User email comments on Library Info : did not create or update x_shce_library_inf_requests using current" information log entry.
So, I guess my question is, what is preventing SN from using the 'current' object to add just the reply text like Incidents?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 08:24 PM
is the same person replying to ServiceNow to whom the email was sent?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 08:31 PM
seems access issue. the user who is replying might not have write access to that record
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 06:06 AM - edited 01-07-2025 06:07 AM
Hi Ankur,
This is in our company's development instance (not my PDI), so the email is being sent to a user's "email" address, but the server is routing to a dummy "system" email account used for just this purpose. That is, the test email is going to "bob@domain.com" but is delivered to "system@domain.com". The reply is thus coming from "system@domain.com" and not "bob". I'm not entirely sure whether the "system" account has the correct permissions to the table/field though.
After some testing, the email is being received and processed by the system, but I have to enable "Emails - Correspondence" on the activity filter on the Journal field in order to see the responses. I'm not sure if this is the same problem or a different one now.