- 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 02:46 AM
Hi
In the topic condition script, use “vaContext.devicetype == Teams” as a condition to exclude topics from the MS Teams channel.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 03:07 AM
Hello Sandeep,
Thank you so much for your reply. I'm a very new developer so I have a question regarding your answer. I edited the current script for one of the topics, but it still shows up in Teams so I'm thinking I did it wrong. Can you please tell me where I need to make the update, or how it should be edited so that it works correctly? My script is below:
(function execute() {
var answer = false;
if(vaContext.portal != 'csm' || !vaContext.portal){
answer=true;
}
vaContext.deviceType == Teams;
if(vaContext.deviceType === 'Teams'){
return false;
}
return answer;
})()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 08:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 12:57 PM
That wouldn't happen though - when you return false, it'll break out of the function and just return true, rendering 'answer' irrelevant.
Not saying that that's good code, but line 6, vaContext.deviceType == Teams; is the only technical issue I can tell.
I did ignore that myself, assuming it was a typo because Tonya does have better code in a different post.