Embedded hyperlinks in Close Notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 09:30 AM - edited 02-16-2024 09:32 AM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 11:37 AM