Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Users should be suggested knowledge articles on Virtual Agent

SM123
Tera Expert

Hello all,

 

The requirement is in esc portal when a user ask a query to Virtual agent it should suggest a knowledge article. could someone help me how to achieve this? 

7 REPLIES 7

Sohail Khilji
Kilo Patron

Hi @SM123 ,

 

You can attain this easily, Please refer the out-of-the-box topic Search Knowledge Base, This will help you build your own topic in Virtual Agent.

 

I hope i answered your query...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hello @Sohail Khilji ,

OOB there is no Knowledge base topic. is there any more plugins need to be installed because i only installed "ITSM Virtual Agent Conversations " plugin.

Yes you may be missing that ... it will look someting like below or you can build one with below logic...

 

SohailKhilji_0-1713447400014.png

 

SohailKhilji_1-1713447400012.png

 

 

Below are the scripts which I have written 

Get KB Articles(Script Action)

var getKBArticle = new GlideRecord('kb_knowledge');
getKBArticle.get('number', vaInputs.article_number.getValue());

var description = getKBArticle.getValue('text').replace(/(<([^>]+)>)/gi, "");
if(description.length > 80) {
description = description.slice(0, 78) + '...';
}

vaVars.short_description = getKBArticle.getValue('short_description');
vaVars.description = description;
 

Get KB Articles(HTML)

<html>
<body>
<p><ahref="/kb_view.do?sysparm_article={{vaInputs.article_number}}"target="_blank">{{vaVars.short_description}}</a></p>
<p>{{vaVars.description}}</p>
</body>
</html>
 
Show Topics(Script Action)
 
(function execute() {
vaSystem.switchTopic(vaVars._setup_explore_help_topic);
})()
 

☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hello @Sohail Khilji ,

I'm new to virtual agent.. is knowledge base not oob? according to the picture i will try to create a topic but Where can i write that script ?