- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 02:22 PM
My organization uses the ability to send an email from a ticket rather extensively. (Screenshot below) However, this causes issues as the update in the email is not captured as a comment. So when clients receive automated email updates with the comment history, the user initiated emails do not appear in the comment history.
My question is: How can user initiated emails (see below) be captured as comments?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 06:17 AM
Just did a quick search on that and ServiceNow actually has a support article for this. I needed this information too so thanks for asking.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745172
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 06:51 AM
I'm not sure how you'll like this, but maybe you could create a BR on the sys_email table. Make sure to run the full code when the target's sys_class_name is the the intended table so it doesn't run fully on all emails. You would take the body of the email and wrap it like [code] <body> [/code] for the comments field.
Example:
var bodyForComment = '';
if(current.instance.sys_class_name == 'incident' && current.type == 'sent'){
bodyForComment += '[code]';
bodyForComment += current.body.toString();
bodyForComment += '[/code]';
var gr = new GlideRecord('incident');
gr.get(current.instance.toString());
gr.comments = bodyForComment;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 03:05 PM
Thank you for the reply, Claude. I had considered this approach, but I believe this would pull in any sent email associated with the incident, not just those manually sent by users. Are you aware of any logic that could limit the emails to just those manually sent (and not automated notifications such as those sent when the ticket itself is updated)?
Thank you again for taking the time to reply!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 06:17 AM
Just did a quick search on that and ServiceNow actually has a support article for this. I needed this information too so thanks for asking.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0745172
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 08:56 AM
It's not perfect, but the header value allows me to limit the emails to just those manually sent via the client. It should make for an quick BR on the email table to inject the email contents as a comment on the ticket.
Thank you, Claude!