- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2019 07:51 AM
I want the Short descritpion to follow email shown here.
You have been mentioned by Root Mathew Xagoraris in CS0026575 "Short Description"
this is my current code, any thoughts? The code below is in Notification Scripts. Note I added current.short_description in the script below, everything but that works.
var recordGR = new GlideRecord(current.table);
var field = current.field_name;
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() + current.short_description +".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + "</a></p>" + '<br>' + 'Comments: ' + current.document[field].getJournalEntry(1));
}
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 08:00 AM
Hi zag
The current object is the live_notification table and this table does not have a short_description field, which is why current.short_description returns undefined. You need to use recordGR.short_description instead - the below seems to work for me:
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
template.print("<span style='font-size: 10pt; font-family: verdana, geneva;'>You have been mentioned by " + current.user_from.name + "in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + ' "' + recordGR.short_description + '"' + "</a></p>");
}
- Matt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 07:43 AM
You cannot have the two </a>s. How does this work?
var recordGR = new GlideRecord(current.table);
var field = current.field_name;
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> : " + recordGR.get(current.short_description) + "</p><br> Comments: " + current.document[field].getJournalEntry(1));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 08:00 AM
Hi zag
The current object is the live_notification table and this table does not have a short_description field, which is why current.short_description returns undefined. You need to use recordGR.short_description instead - the below seems to work for me:
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
template.print("<span style='font-size: 10pt; font-family: verdana, geneva;'>You have been mentioned by " + current.user_from.name + "in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + ' "' + recordGR.short_description + '"' + "</a></p>");
}
- Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 08:09 AM
that did it thanks