Sent/Recieved Emails in Ticket Conversations widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 09:33 PM
Hi Community
Is there anyone in here who have tried to incorporate the "Sent/Recieved Emails" functionality into the Ticket Conversations widget?
The obvious upside for this is that if you do not copy email content into comments its still possible for the end user to see mails back and forth.
Regards
Simon
- 7,500 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2020 01:30 PM
Hi @balajig,
Hope by this time you would have already worked out the solution, but just wanted to mention here, so it may be helpful for members looking on to this post. Replacing the code with the below snippet will help:
var mailtype = "";
if (mailgr.mailbox.getDisplayValue() == 'Sent')
{
mailtype = "<strong>Sent email:</strong> \n";
tempobj.field_label = "Email Sent";
}
else
{
mailtype = "<strong>Received email:</strong> \n";
tempobj.field_label = "Email Received";
}
tempobj.value = mailgr.body.toString();
data.stream.entries.push(tempobj);
}
Major change: tempobj.value = mailgr.body.toString();
I used 'body' field in place of 'body_text' field
Regards,
Raji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
In addition to this, I find it helpful to suffix a replaceAll to remove linebreaks i.e.:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2021 06:01 AM
I know this an old post. I'm hoping the main people are still around. The widget in question appears to have been updated since the original posts and so the code above would be inserted at around line 109.
However, I've added the code as instructed and then changed all references from record. to data.
I also tried Raji's code snippet in place of the last bit.
Nothing worked. I assume it depends on the user having access to emails? I don't know how things are supposed to work but my portal users (i.e. external customers) have no roles assigned. I don't know if this is because we are using the ITSM version of ServiceNow rather than the CSM version.
I will do a test to see if adding a portal user role and then using ACL's to give them access to emails sent from their own tickets makes any difference.
(Note: These users cannot access the backend UI but when I impersonate them they cannot see the emails on the standard task form either).
I logged a ticket with HI and got the same response as everyone else so they haven't developed a solution to this in the intervening years.
Can anyone please take another look at this an advise me how to proceed please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2021 06:35 AM
I found a post that refers to a UI Property that contains a list of roles that can view email in the activity log (assuming ACLs etc.) I added the snc_external role to the list and then gave it to one user in DEV.
Now, that user can see the emails in the backend UI but still not on the portal so I now know that this isn't an ACL issue but is all down to the widget.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2021 06:47 AM
There is an "idea" here and so, if you want ServiceNow to redevelop the Ticket Conversation widget to allow us to easily manage which types of activities are displayed, you can upvote this suggestion by clicking the button.