Skip to content

Commit 5e10695

Browse files
authored
Create script.js
1 parent 1bd225c commit 5e10695

File tree

1 file changed

+15
-0
lines changed
  • Specialized Areas/Notifications/Add KB Article Link Dynamic Email Script to Notification

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//Add KB Article Link Dynamic Email Script to Notification
2+
// This script assumes it is used in a notification triggered by the kb_knowledge table.
3+
//use this line to get KB Number ${mail_script:get_kbarticle_link}
4+
//NOTE THE NAME OF THIS SCRIPT IS "get_kbarticle_link"IN EMAIL SCRIPTS TABLE _ "sys_script_email"
5+
6+
7+
(function executeEmailScript(current, template) {
8+
// Construct the URL to the KB article
9+
10+
var instanceURL = gs.getProperty('glide.servlet.uri'); // Get the instance URL
11+
var kbLink = instanceURL + "kb_view.do?sysparm_article=" + current.number; // Adjust based on your URL structure
12+
13+
// Output the link in HTML format
14+
template.print('<a href="' + kbLink + '" target="_blank">' + current.number + '</a>');
15+
})(current, template);

0 commit comments

Comments
 (0)