
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 06:29 AM - edited 12-12-2023 06:36 AM
Hi
Need quick help with suggestions or any reference for below use case:
" Need to send URL Link as hyperlink in email notification from activity log of task table instead of HTML plain text with codes. The URL link will direct to other application as it's not from SN platform rather for different application."
Dashboard: [code]<a href="https://cyz.com/d/&orgId=1&refresh=1m&var-DB=argos-muc9&var-namespace=o=1700735762000" target="_blank">click here to see the dashboard</a>[/code]
UI: [code]<a href="https://xyz.net/projects/D=udi-synchro-tst" target="_blank">click here to go to UI</a>[/code]
NOTE: Have tried and explore the URI and URI_REF since the reference is not for ServiceNow record for any field it doesn't help.
Thanks for all help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 07:16 AM
Here is the Reference Code: @Community Alums
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Remove the [code] tag from HTML hyperlink from incident activity log to send notification as link
var lastcomments = current.u_last_comment;
var apendcmntLink = lastcomments.replace(/\[code\]/g, '').replace(/\[\/code\]/g, '<br/>');
template.print(apendcmntLink + '\n');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 06:37 AM
Hiii @Community Alums
Seems you are passing HTML syntax [code] [/code] within your update in activity log of incident that hamper when it send as notification and result to plain text.
Suggest to try by removing the [code] tag from your notification and giving it a try.
Hint: Try to create an email script for u_last_comment or comment that send for notification for activity log update and pass the email script instead of field 'u_last_comment'
You can use regex command to remove the HTML tag in your email script.
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 07:16 AM
Here is the Reference Code: @Community Alums
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Remove the [code] tag from HTML hyperlink from incident activity log to send notification as link
var lastcomments = current.u_last_comment;
var apendcmntLink = lastcomments.replace(/\[code\]/g, '').replace(/\[\/code\]/g, '<br/>');
template.print(apendcmntLink + '\n');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 11:31 AM
Hi, the solution would be to construct your link in a Notification Email Script and then add this to the notification message.
Scripting for email notifications (servicenow.com)
Examples from a PDI
/sys_script_email_list.do?sysparm_query=scriptLIKEhref&sysparm_view=