<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Resolve UI action not working properly in Workspace. in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2949315#M1118436</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7272"&gt;@Mark Manders&lt;/a&gt;&amp;nbsp;here is the code for the UI action below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on Click:&amp;nbsp;resolveIncident();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;condition:&amp;nbsp;(current.incident_state != IncidentState.CLOSED &amp;amp;&amp;amp; current.incident_state != IncidentState.RESOLVED &amp;amp;&amp;amp; current.incident_state != IncidentState.CANCELED) &amp;amp;&amp;amp; (gs.hasRole("itil") || gs.hasRole("itil_admin") || current.caller_id == gs.getUserID())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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);
		
		
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the workspace form button is unchecked and there is no script there but somehow the UI is still showing on the workspace.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OOB UI action with the workspace form button checked is disabled.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 May 2024 12:41:07 GMT</pubDate>
    <dc:creator>snow_beginner</dc:creator>
    <dc:date>2024-05-31T12:41:07Z</dc:date>
    <item>
      <title>Resolve UI action not working properly in Workspace.</title>
      <link>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2946812#M1117749</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-05-29 135917.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/360681i9F066D6003A57157/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-05-29 135917.png" alt="Screenshot 2024-05-29 135917.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and then adding the resolution notes (dont't save using the floppy disk icon) then clicking on the actual resolve button at the top&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-05-29 140110.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/360682iB887E9E90A6CA33B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-05-29 140110.png" alt="Screenshot 2024-05-29 140110.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the details of the code and notes get copied over when the resolve UI action makes these fields pop up.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-05-29 140135.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/360683i6F419052BAA8907E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-05-29 140135.png" alt="Screenshot 2024-05-29 140135.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is OOB functionality and is working in PDI but its not working in our instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 13:12:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2946812#M1117749</guid>
      <dc:creator>snow_beginner</dc:creator>
      <dc:date>2024-05-29T13:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve UI action not working properly in Workspace.</title>
      <link>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2946819#M1117752</link>
      <description>&lt;P&gt;Please share your code, since it is probably in there.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 13:19:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2946819#M1117752</guid>
      <dc:creator>Mark Manders</dc:creator>
      <dc:date>2024-05-29T13:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve UI action not working properly in Workspace.</title>
      <link>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2949315#M1118436</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/7272"&gt;@Mark Manders&lt;/a&gt;&amp;nbsp;here is the code for the UI action below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on Click:&amp;nbsp;resolveIncident();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;condition:&amp;nbsp;(current.incident_state != IncidentState.CLOSED &amp;amp;&amp;amp; current.incident_state != IncidentState.RESOLVED &amp;amp;&amp;amp; current.incident_state != IncidentState.CANCELED) &amp;amp;&amp;amp; (gs.hasRole("itil") || gs.hasRole("itil_admin") || current.caller_id == gs.getUserID())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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);
		
		
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the workspace form button is unchecked and there is no script there but somehow the UI is still showing on the workspace.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OOB UI action with the workspace form button checked is disabled.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 12:41:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2949315#M1118436</guid>
      <dc:creator>snow_beginner</dc:creator>
      <dc:date>2024-05-31T12:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve UI action not working properly in Workspace.</title>
      <link>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2982094#M1128134</link>
      <description>&lt;P&gt;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 ???&lt;/P&gt;&lt;P&gt;Searching I have found there is a&amp;nbsp;&lt;SPAN&gt;Known issue KB1202338 Service operations Workspace: Resolve button does not work on incident form&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Jul 2024 14:29:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/resolve-ui-action-not-working-properly-in-workspace/m-p/2982094#M1128134</guid>
      <dc:creator>gaynor_tpp</dc:creator>
      <dc:date>2024-07-05T14:29:55Z</dc:date>
    </item>
  </channel>
</rss>

