How do I remove a topic from MS Teams Virtual Agent bot, but leave it visible on portals? ***HELP NEEDED***

Still Learning
Kilo Sage

I have a requirement to restrict VA Topics in the ME Teams Now Agent app to only show CSM topics. Today, all topics appear in the list of available topics. How do I restrict the list of topics in MS Teams without impacting its visibility on portals? 

1 ACCEPTED SOLUTION

I just added a reply that perhaps could explain your issue...

Are you still using the Now Virtual Agent Teams app? If so, you will need to use vaContext.deviceType == 'teams' (lowercase t).

While you're at it though, add an OR condition or a .toLowerCase() so this condition doesn't break when you move to the new Teams app (ServiceNow for Teams) which uses a capital T "Teams" deviceType.

View solution in original post

8 REPLIES 8

This is the correct answer but I will add an important note that may be relevant for some longer-term Teams setups: for some bizarre reason, ServiceNow changed the deviceType options from the old Teams app (Now Virtual Agent) to the new Teams app (ServiceNow for Teams).

Teams App Value Display Value
Now Virtual Agent (old) teams Microsoft Teams
ServiceNow for Teams (current) Teams Teams

 

When running queries on the Conversation table, this capitalization distinction doesn't matter - all your Teams conversations will appear, old and new.

But if you're scripting anything in VA, this capitalization matters and can be make or break - especially if you're on the old app or switched over from the old app.

Still Learning
Kilo Sage

I also updated the script to read as follows but it still does not work.  Can you please tell me what I'm doing wrong?

(function execute() {
    var answer = false;
    if(vaContext.portal != 'csm' || !vaContext.portal){
        answer=true;

    if(vaContext.deviceType == 'Teams'){
        answer=false;
    }
    }

    return answer;
})()

 

I just added a reply that perhaps could explain your issue...

Are you still using the Now Virtual Agent Teams app? If so, you will need to use vaContext.deviceType == 'teams' (lowercase t).

While you're at it though, add an OR condition or a .toLowerCase() so this condition doesn't break when you move to the new Teams app (ServiceNow for Teams) which uses a capital T "Teams" deviceType.

Thank you so much Chris!! This actually solved my issue. I needed to use the lowercase 'teams'. I didn't realize it would be case sensitive.  Thank you so much for your help!!