- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 02:31 AM
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?
Solved! Go to Solution.
- Labels:
-
Agent Chat
-
AI Search
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 07:56 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 07:52 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 03:47 AM
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;
})()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 07:56 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 10:16 AM
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!!