How to restrict va topic as per portals?

veenal
Tera Contributor

Hi , 

I was trying to restrict the visibility of topic as per portal .. we were able to achieve this by adding 

1. modified agent chat record for specific portal with below condition - 

skip_load_history = true;
2. Added a script to topic as per visibility :
(function execute() {
if(vaContext.portal == 'esc'){
return true;
}
else{
return false;
}
})()
It worked but some of the topics already have script configured for them like :
(function execute() {
var applicability = false;
var userId = gs.getUserID();
var gr = new GlideRecord('sn_hr_core_profile');
gr.addEncodedQuery('user='+userId);
gr.query();
if(gr.next()) {
applicability = true;
}
return applicability;
})()
how would i merge 2nd condition of restricting VA topic to above script .
Thanks and Regards,
Veenal
2 REPLIES 2

Abbas_5
Tera Sage
Tera Sage

Hello @veenal,

Please check this kb article :
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0996639

 

If it is helpful, please mark it as helpful and accept the correct solution.

Thanks & Regards,

Abbas Shaik

 

veenal
Tera Contributor

Hi Abbas, 

This solution works if script is empty but how to incorporate this when we already have script available . 

PFA screenshot.

veenal_0-1710843690965.png

Regards,

Veenal