Adding KB Article link to the notification of the request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 04:06 PM
Hello!!!
I want to add the related KB Article links to the notification of the raised request that being sent, by assigning related KB Articles to corresponding with catalog items.
For example: If someone wants to reset a password and they raised a request to reset a password, we have to provide them the related link of the KB Article in the notification they receive once they submit the request ,so that the person can try it and reset the password within time and by relating it with article by not waiting till the ticket is resolved.
So, how to add the KB Article link in the notification the client receives??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 04:14 PM - edited 12-18-2023 05:52 PM
Hi @Priya2420 ,
First you can map that KB article with catalog item and based on selected option set the desire KB to some variable at task level ( or in variables with hidden type )
Second, write a mail script code and fetch this KB from task and print using temple.print() method ms use this mail script in email notification using ${mail_script_name}
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 06:28 PM
Can you help me with the email script ,please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 07:11 PM
@Priya2420 : Below is the email script that gives you an idea. call this email script in your notification at the end by using ${mail_script:your_email_script_name}
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var optionSelectedByUser = current.variables.your_field_name;
var KBArticleMapping = {
'passwordreset': 'KB123456',
'outlookissue': 'KB456789'
}; // Assuming passwordreset, outlookissue as options of your variable and corresponding KB article is something you are planning to show.
var revelantArticle = KBArticleMapping[optionSelectedByUser];
var hlink = '/kb_view.do?sysparm_article=' + revelantArticle;
var link = '<a href=' + hlink + '>' + revelantArticle + '</a>';
template.print(link);
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 06:40 AM
@Priya2420 : Any luck on the code I shared ?