- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2019 10:57 AM
Hi all,
Have been updating the OOB "You have been mentioned" notification to include some more information so the user can decide if they need to action immediately or at all. Have successfully brought in the actual comment that was made, but struggling to get the short description in
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
var displayValue = recordGR.getDisplayValue();
var subjectText = displayValue
? displayValue
: "a record discussion";
var tableDisplay = recordGR.getClassDisplayValue();
var linkText = displayValue
? "the " + tableDisplay + " record " + displayValue
: "this " + tableDisplay + " record ";
//Next line defines the Subject of the mail
email.setSubject("You have been mentioned in " + subjectText);
//Next line defines the Short Description
template.print("Short Description: " + current.short_description.getDisplayValue()+ "<br />");
//Next line defines the link to incident record
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() + "'>" + linkText + "</a></p>");
//This segment displays the actual comment in the notification mail
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 />");
}
}
Pretty sure I'm displaying the value of short description incorrectly, would love another set of eyes on this please.
Thanks as always!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2019 11:03 AM
Do you need to use
template.print("Short Description: " + recordGR.short_description.getDisplayValue()+ "<br />");
instead of
template.print("Short Description: " + current.short_description.getDisplayValue()+ "<br />");
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2019 10:59 AM
You can just do current.short_description. .getDisplayValue is for reference fields, instead of displaying their value (sys_id) it will show their display value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2019 08:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2019 11:03 AM
Do you need to use
template.print("Short Description: " + recordGR.short_description.getDisplayValue()+ "<br />");
instead of
template.print("Short Description: " + current.short_description.getDisplayValue()+ "<br />");
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2019 08:54 AM
