UI Scripts Broken with Agent Workspace & Xanadu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 10:31 AM
It Seems like UI Scripts have been broken in the context of Xanadu and Agent Workspace.
After upgrading to Xanadu UI Scripts can't be loaded from UI Actions or UI Policies within Agent Workspace.
I know that Agent Workspace is no longer supported, but this is a major breakage and the underlying cause can easily be worked around with some proper logic.
The feachAndStoreScripts() function called to load any UI scripts into the g_ui_scripts object is failing due to some cache blocking logic that that was added in Xanadu. (See below)
function fetchAndStoreScripts(isAsync, uiScripts, name, resolve) {
resolve = resolve || NO_OP;
var request = new XMLHttpRequest();
var cacheBuster = window.NOW.ui_scripts_version_map[name] || '';
var url = '/' + name + '.jsdbx' + (cacheBuster ? '?v=' + cacheBuster : '');
request.open('GET', url, isAsync);
var handleResponse = function() {
if (request.status >= 200 && request.status < 300 && request.responseText) {
uiScripts[name] = createSandboxUIScript(name, request.responseText);
if (isAsync) {
resolve(uiScripts[name]);
}
} else {
console.error('Failed to fetch ' + name + '.jsdbx: Status code ' + request.status);
}
};
Specifically the following line is throwing an error because the "ui_scripts_version_map" does not exist in Agent Workspace.
var cacheBuster = window.NOW.ui_scripts_version_map[name] || '';
If this was adjusted to simply fallback to empty or undefined, the rest of the logic would like function as before. Instead an error is thrown and the script is not loaded into g_ui_scripts preventing it from being loaded from UI Policies or UI Actions.
I am not sure if there is a workaround or fix available aside from duplicating all of the UI Script logic directly in the UI Action and/or UI Policy -- which is not ideal and defeats the purpose of the UI Script in the first place.
Cheers,
Kevin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 12:15 AM
In stead of fixing everything or working around it, why not use the same effort to move away from Agent Workspace? As you stated yourself: it's no longer supported. Anything that breaks will need to be fixed by you, because ServiceNow will only answer 'use configurable workspaces'.
Not moving away from the Agent Workspace now, will have you put huge amounts of time and effort (and with that, your companies money) and with the next upgrade (or maybe even patch), you get the next issues and you are throwing time and money at it again.
And your answer is probably going to be that you don't have time to move now, but when will you have that time? You can only use every penny once and every minute that goes by will never come back. Don't workaround or fix things that are no longer supported, because that will become your permanent job that will never end (it will get harder and harder to keep Agent Workspace working as your user expect it to).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 06:49 AM
Agreed, we (as an organization) provide a 3rd party add-on that integrates with INC and IMS records. Our solution was written to work with all interfaces: Classic UI, Agent Workspace and Service Operation Workspace.
Unfortunately, we have multiple customers that are still using Agent Workspace, and when they upgrade to Xanadu our solution will break on Agent Workspace because of this change. It still works fine on Classic and Service Operation Workspace.
Unless ServiceNow actively prevents customers from using Agent Workspace, they will continue to put off upgrading/migrating. It should either be supported, or scheduled for complete removal. It has been deprecated for 4 releases now. As a 3rd party vendor it puts us in an awkward situation as we want to keep our customers happy.