Embedded hyperlinks in Close Notes

dani456ni
Tera Contributor

Hi, 

I have a workflow which generates Close Notes to be displayed in a Notification in the Resolution Section.

I can't find a way to add embedded hyperlinks into the Close Notes because it will display the notification with the HTML syntax instead. (see image)

Here's the code I'm using on the scripts background as example:

// Specify the Sys ID of the Requested Item
var requestedItemId = 'bab76b07c3548210abfff25c05013105';

// Assuming you have a hyperlink URL and text
var hyperlinkURL = 'https://example.com';
var hyperlinkText = 'Click here for more information';

// Create a GlideRecord for the sc_req_item table
var requestedItemGR = new GlideRecord('sc_req_item');

// Check if the Requested Item record exists
if (requestedItemGR.get(requestedItemId)) {
// Compose the close notes with the embedded hyperlink
var closeNotes = 'The issue has been resolved. For more information, please [Click here for more information|' + hyperlinkURL + '].';

// Set the close notes in the Requested Item
requestedItemGR.setValue('close_notes', closeNotes);
requestedItemGR.update(); // Save the record if necessary

gs.info('Close notes updated successfully for Requested Item with SysID: ' + requestedItemId);
} else {
gs.error('Requested Item not found with SysID: ' + requestedItemId);
}

5 REPLIES 5

dani456ni
Tera Contributor

I understand that in the Close Notes the Dictionary Entry is only allowing String, but the [code] escaping method is not working, the resolution text is comin as HTML formatted code instead of text with the embedded hyperlink.