- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 03:27 AM
So in the OOB Notification - "Activity Stream @Mention Email" it shows as
Now the requirement is, in this email can we include and show the comment that is tagged in ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 04:43 AM
Hi @gayatri38 ,
Navigate to System Notification>Email> notification Email Scripts
open the ng_activity_mention_body email script :
Update the script to something similar to this
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
email.setSubject("You have been mentioned in " + recordGR.getDisplayValue());
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>You have been mentioned by " + current.user_from.name + " in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + "</a></p>");
if (current.field_name == "comments") {
template.print(recordGR.comments.getJournalEntry(1) + "<br />");
}
else if (current.field_name == "work_notes") {
template.print(recordGR.work_notes.getJournalEntry(1) + "<br />");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 04:40 AM
Something like this: https://www.servicenow.com/community/developer-forum/change-mail-script-to-display-quot-mentions-quo...?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 04:43 AM
Hi @gayatri38 ,
Navigate to System Notification>Email> notification Email Scripts
open the ng_activity_mention_body email script :
Update the script to something similar to this
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
email.setSubject("You have been mentioned in " + recordGR.getDisplayValue());
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>You have been mentioned by " + current.user_from.name + " in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + "</a></p>");
if (current.field_name == "comments") {
template.print(recordGR.comments.getJournalEntry(1) + "<br />");
}
else if (current.field_name == "work_notes") {
template.print(recordGR.work_notes.getJournalEntry(1) + "<br />");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 05:47 AM
Thanks Sandeep, It worked fine , so just a quick question is there a way to put down the entire comments history if required in this acitivity stream email?