Customizing Resolve Incident button (UI Action Resolve_Incident)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2013 08:49 AM
I am trying to change the behavior of the Resolve Incident button:
Right now, it changes the Incident status to Resolved AND closes current Incident form (back to the list of incidents).
I want it to just replicate what would be the action of changing the drop-down on the Incident State field to Resolved (not leaving the Incident screen)
The code behind this UI Action (resolve_incident) is:
*********************
Condition:
(current.incident_state != 7 && current.incident_state != 6)
Action:
current.incident_state = 6;
current.update();
*********************
I've tried to comment out the update() line, but it would still close the form, and I am back to the list of incidents.
Any suggestions would be greatly appreciated.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2013 09:12 AM
In that UI action you can use : http://wiki.servicenow.com/index.php?title=UI_Actions#Redirect_to_a_URL
You can use "current"
action.setRedirectURL(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2013 10:13 AM
Thank you, Jonathan - it worked (sort of)
The only problem remaining is that it still updates the DB when I click Resolve Incident button.
Unlike choosing Resolve Incident from the drop-down list, where I can still back out of it by clicking green Back button.
Where do I find the Method Summary for action. AND current. ? I can only see it for gs.
Thanks again,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2013 12:12 PM
Got it working - thanks.
How can I 'hide' the Resolve Incident button once it had been clicked?
Right now it remains on the form, enabled, even after the status of the incident had changed (as it should) to Resolved.
Basically, once the Resolved Incident button is clicked, I want the user to either enter closing notes and click Update, or bail out.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2013 10:29 AM
Hi Gene,
I see, sorry I didn't know you that you wanted to not commit to the DB.
For info on current, previous, g_scratchpad:
http://wiki.servicenow.com/index.php?title=Business_Rules#Business_Rule_Variables_are_Global
The Resolve Incident UI action is unique in that it works both client and server side.
So a few things to make it work the way you want.
If you get a chance I updated the button in this demo - https://demo014.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=38c073d7465762820116c37c3353540f
You will want to comment out the part that executes on the server. Current is a server side. the g_form. is client side.
See the attached image for the parts to comment out.