Request Approval UI Action in Agent Workspace

Gerard9
Giga Contributor

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

find_real_file.png

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

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.

View solution in original post

8 REPLIES 8

Maik Skoddow
Tera Patron
Tera Patron

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

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

Maik Skoddow
Tera Patron
Tera Patron

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.

Hi @Gerard ,

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.