Adding KB Article link to the notification of the request

Priya2420
Tera Contributor

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??

 

8 REPLIES 8

AshishKM
Kilo Patron
Kilo Patron

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

Can you help me with the email script ,please?

@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);

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
 
Regards,
Sainath N

@Priya2420 : Any luck on the code I shared ?

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
 
Regards,
Sainath N