Confirmation popup on close incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2016 01:41 AM
As an ESS / ITIL user (legacy view and Portal View) for Incidents and Service Requests, Problem. Once i click on Close UI action Button or user change manually state to close I should get a pop up message as confirmation "Are you sure you want to close this ticket ?"
Here I am using below code but when click on cancel incident is getting closed for UI action. Any suggestion??
onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var value =g_form.getValue('incident_state');// field name
if(value==7) // field value
{
if(confirm("Do you want to close"))
{
g_form.save();
}
else
{
g_form.setValue('incident_state',oldValue);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2016 02:11 AM
HI Anupriya,
what is your UI Action code look like? Do you want to paste it over here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2016 02:24 AM
using below in ui action-
current.incident_state = IncidentState.CLOSED;
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2017 04:11 AM
thankyou

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2016 02:35 AM
Hi Anupriya,
Do you have incident_state field on the form layout? g_form.getValue() might not work if the field is not on the form layout. (hidden or otherwise)
This is a onChange client script and you're trying to set the value of the incident state through UI Action on Server Side. If you want to stop the processing of the UI Action, use client script within the UI Action. Something like this http://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Thanks,
Mandar