Resolve UI action not working properly in Workspace.

snow_beginner
Mega Guru

Hi,

In Service Operations Worskpace, if you have an incident assigned to you and you fill out the resolve fields on the workspace by choosing the resolution code

Screenshot 2024-05-29 135917.png

and then adding the resolution notes (dont't save using the floppy disk icon) then clicking on the actual resolve button at the top 

Screenshot 2024-05-29 140110.png

the details of the code and notes get copied over when the resolve UI action makes these fields pop up.

Screenshot 2024-05-29 140135.png

This is OOB functionality and is working in PDI but its not working in our instance.

 

The resolve UI action is customized in our instance but only so that you need to close the incident tasks before you can close the incident. I have played around by activating and inactivating the OOB and customised UI action and adding the additional code to the OOB UI action but that's not helping change the behavior. What could be causing this issue?

 

Thanks.

3 REPLIES 3

Mark Manders
Mega Patron

Please share your code, since it is probably in there.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

snow_beginner
Mega Guru

Hi @Mark Manders here is the code for the UI action below:

 

on Click: resolveIncident();

 

condition: (current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.RESOLVED && current.incident_state != IncidentState.CANCELED) && (gs.hasRole("itil") || gs.hasRole("itil_admin") || current.caller_id == gs.getUserID())

 

script:

function resolveIncident(){
	//Set the 'Incident state' and 'State' values to 'Resolved', and display mandatory fields
	g_form.setValue('incident_state', 6);
	g_form.setValue('state', 6);
	g_form.setValue('resolved_by', g_user.userID);
	
	gsftSubmit(null, g_form.getFormElement(), 'resolve_inc'); //MUST call the 'Action name' set in this UI Action
}

//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
	serverResolve();

function serverResolve(){
	
	//checkOpenTasks();
	current.incident_state = IncidentState.RESOLVED;
	current.update();
	current.resolved_by = gs.getUserID();
}

function checkOpenTasks() {
	var grIncidentTask = new GlideRecord('incident_task');
	grIncidentTask.addActiveQuery();
	grIncidentTask.addQuery('parent',current.sys_id);
	grIncidentTask.query();
	if (grIncidentTask.hasNext()) {
	
		current.setAbortAction(true);
		gs.addErrorMessage('All Incident Tasks must be closed before an Incident can be resolved');
		action.setRedirectURL(current);
		
		
	}
}

 

the workspace form button is unchecked and there is no script there but somehow the UI is still showing on the workspace. 

 

The OOB UI action with the workspace form button checked is disabled. 

 

 

gaynor_tpp
Tera Contributor

Got the same issue, test in two PIs, works ok, try it in customer's instance, just upgraded to Washington DC and it, tried to amend it and ended up with 2 Resolve buttons, one worked, the other didn't! Exported the working UI action record from PI and into customer instance and still not working ???

Searching I have found there is a Known issue KB1202338 Service operations Workspace: Resolve button does not work on incident form