- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:47 PM
We are migrating the team into Agent Workspace and they love it.
But i cant get the "Request Approval" UI Action to work in the Agent Workspace. It works fine in the classic UI. The button appears in the Agent Workspace, but clicking the button does nothing. What am i missing? Screenshots below.
Thanks in advance
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 08:29 PM
Hi Gerard,
the correct code for the field "Workspace Client Script" must be as follows:
function onClick(g_form) {
var ga = new GlideAjax("ChangeRequestStateHandlerAjax");
ga.addParam("sysparm_name", "getNextStateValues");
ga.addParam("sysparm_change_sys_id", g_form.getUniqueValue());
ga.addParam("sysparm_change_type", g_form.getValue("type"));
ga.getXMLAnswer(function(stateValues) {
var returnedStates = JSON.parse(stateValues);
g_form.setValue("state", returnedStates[0]);
g_form.submit('state_model_request_assess_approval');
});
}
There were two lines that do not work at Workspace and therefore were replaced by a modified version:
old | new |
var returnedStates = stateValues.evalJSON(); | var returnedStates = JSON.parse(stateValues); |
gsftSubmit(null, g_form.getFormElement(), 'state_model_request_assess_approval'); | g_form.submit('state_model_request_assess_approval'); |
To my mind it makes no sense to "repair" all UI Actions for change requests. At the moment, the Agent Workspace is not a fully functional replacement for the classic user interface and there are some tools which cannot be rendert at Workspace (for example Confict Calendar).
Kind regards
Maik
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:52 PM
Hi
the code at field "Workspace Client Script" do not work at Workspaces and needs to be modified. I assume you copied from the script field.
After some investigations I am really irritated because it seems that the UI Actions for change requests are not mapped to Workspace Actions.
But if you give me some time I will try to implement them.
Regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 02:31 AM
Thanks Maik,
I did copy it down. Which worked for other UI Actions, eg Resolve on the INC ticket. But even in DEV there is no code for the Workspace Actions. And i cant find anything in docs that explain what needs to be different.
Thanks and regards
Gerard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 08:29 PM
Hi Gerard,
the correct code for the field "Workspace Client Script" must be as follows:
function onClick(g_form) {
var ga = new GlideAjax("ChangeRequestStateHandlerAjax");
ga.addParam("sysparm_name", "getNextStateValues");
ga.addParam("sysparm_change_sys_id", g_form.getUniqueValue());
ga.addParam("sysparm_change_type", g_form.getValue("type"));
ga.getXMLAnswer(function(stateValues) {
var returnedStates = JSON.parse(stateValues);
g_form.setValue("state", returnedStates[0]);
g_form.submit('state_model_request_assess_approval');
});
}
There were two lines that do not work at Workspace and therefore were replaced by a modified version:
old | new |
var returnedStates = stateValues.evalJSON(); | var returnedStates = JSON.parse(stateValues); |
gsftSubmit(null, g_form.getFormElement(), 'state_model_request_assess_approval'); | g_form.submit('state_model_request_assess_approval'); |
To my mind it makes no sense to "repair" all UI Actions for change requests. At the moment, the Agent Workspace is not a fully functional replacement for the classic user interface and there are some tools which cannot be rendert at Workspace (for example Confict Calendar).
Kind regards
Maik
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 04:30 AM
Hi
Any news here? I am very interested to hear if the solution I provided has worked for you.
Kind regards
Maik
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.