DocumentID not displaying record number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 02:18 AM
Hi,
In the Activity Stream @Mention Email notification, the document ID is not populating the records number in certain scenarios, like, story table and idea table
THE EMAIL SCRIPT BODY:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var result = new ActivityMentionEmailValues().getEmailValues(current.table, current.document);
if (result) {
result = JSON.parse(result);
email.setSubject(gs.getMessage("You have been mentioned in {0}", result.subjectText));
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>");
template.print(gs.getMessage("You have been mentioned by {0} in", current.user_from.name));
template.print(" <a href='/nav_to.do?uri=" + result.className + ".do?sys_id=" + result.recordSysId + "'>" + result.linkText + "</a></p>");
}
})(current, template, email, email_action, event);
------------------------
SCRIPT INCLUDE:
var ActivityMentionEmailValues = Class.create();
ActivityMentionEmailValues.prototype = {
initialize: function() {
},
getEmailValues: function(table, sysId) {
var result = {};
var recordGR = new GlideRecord(table);
if (!recordGR.get(sysId))
return;
var displayValue = recordGR.getDisplayValue();
result.subjectText = displayValue
? displayValue
: "a record discussion";
var tableDisplay = recordGR.getClassDisplayValue();
result.linkText = displayValue
? "the " + tableDisplay + " record " + displayValue
: "this " + tableDisplay + " record ";
result.className = recordGR.getRecordClassName();
result.recordSysId = recordGR.getUniqueValue();
return JSON.stringify(result);
},
type: 'ActivityMentionEmailValues'
};
The incident, scrumtasks notifications are working fine as the TITLE field takes the record number but in case of STORY and IDEA, the short desc is displayed instead of record number..
Any help on populating the stry notifications with record number would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2023 07:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2023 07:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 01:50 PM
@Swetha M- I believe the rm_story table has a dictionary override in place so that its records' display values, when referenced, are the Stories' short descriptions, as opposed to the number field. If you remove or disable that override, you will see the Story number. This would be changing an OOTB configuration though.
If this helped please mark helpful. If this answered your issue, please mark correct. Thanks!