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

Anurag Tripathi
Mega Patron
Mega Patron

One think I noticed form the screenshot was that the code tags were wrong. 

It should be like this

[code] [/code]

And yours are like below, missing the / in the closing tag

[code] [code]

-Anurag

Hey Anurag, 

I have tried both ways, and the outcome is the same one 😕 

Anirudh Pathak
Mega Sage

I checked this post earlier but this only works for Work Notes, I'm trying to display the HyperLink in the Close Notes in the Resolution Information section which are going to automatically pulled up on the Notification when sent.