Virtual Agent is unresponsive in MS Teams
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am experiencing an issue with the Virtual Agent in Microsoft Teams.
Yesterday, we migrated the Update Set to PROD , which includes a topic and a Script Include used to retrieve the user's contact number for the Incident record.
Initially, the Virtual Agent worked as expected, but after a few hours, it started experiencing significant delays and is no longer providing a response.
Script In Topic Node :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Chinmay,
Since it was working initially and then became slow/unresponsive, this usually points to runtime or integration issues, not just a script problem.
Your script itself looks mostly fine, but a few areas could cause delays in Virtual Agent (especially in MS Teams).
Things to check
1. Logs first (most important)
Check:
- System Logs → All
- Virtual Agent logs
Look for:
- Script timeouts
- Errors in Script Include
- Delays during
insert()
If VA is not responding, there’s often a backend delay or failure.
2. Potential performance issue in your script
This part can slow things down:
var userGr = new GlideRecord("sys_user");
userGr.addQuery('sys_id',vaInputs.caller);
userGr.query();
if(userGr.next()){
businessPhone = userGr.phone;
}
Since you already have caller, you can simplify:
var userGr = new GlideRecord("sys_user");
if (userGr.get(vaInputs.caller)) {
businessPhone = userGr.getValue("phone");
}
This avoids an unnecessary query loop.
3. Universal Request creation (common culprit)
Your script is doing:
- UR creation
- Incident creation
- UR update
If Universal Request plugin or property is enabled:
- This adds extra processing
- Can slow down or fail silently
Try testing by temporarily bypassing:
var universalgr = null;
and see if performance improves.
4. MS Teams integration latency
Since issue is in Teams:
- Check Bot / Teams channel health
- Sometimes:
- Teams → ServiceNow connector delays
- Token/auth refresh issues
- Network latency
Test same topic in:
- Virtual Agent web client
If it works there → issue is Teams integration, not your script
5. Assignment group property
This line is risky:
var assignment_group = gs.getProperty('SP_IT Corp Support');
Make sure:
- Property exists
- Returns a valid sys_id, not name
If invalid → insert may hang or fail
6. Transaction timeout
If script takes too long:
- VA in Teams may appear “stuck”
- Even if backend eventually completes
7. Debug suggestion
Add logs to isolate delay:
gs.log("Before incident create");
...
gs.log("After incident create");
This helps identify where it’s slowing down.
