- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
In Employee center after an incident is resolved, the caller is given two buttons to either close the incident or reopen it.
But, if the caller clicks on close button accidently it will be permanently closed.
We want to give a prompt to user when they click on the close button as a warning so that after that only a user will close the incident.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
You will want to create a new UI action and disable the existing one. Here are some screen shots of the one I created in my PDI that worked for both the workspace and client.
Here's the code for the script:
function IncComplete() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass('glide_confirm_basic');
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setPreference('title', new GwtMessage().getMessage("Are you sure you want to close this ticket?"));
dialog.setPreference('onPromptComplete', SNcompleteCallbackFunction);
dialog.render();
}
function SNcompleteCallbackFunction() {
gsftSubmit(null, g_form.getFormElement(), 'close_incident');
}
current.incident_state = IncidentState.CLOSED;
current.state = IncidentState.CLOSED;
current.update();
gs.addInfoMessage("Incident completed.");
Here's the code for the Workspace Script:
function onClick(g_form) {
var title = getMessage('Confirmation');
var message = getMessage("Are you sure you want to close this ticket?");
g_modal.confirm(title, message).then(
function onSuccess() {
g_form.submit('close_incident');
}
);
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
This was solved with the help of @JenniferRah and Gemini in native view and Service Operation Workspace.
In employee center, It was done by going to standard ticket confirguration.
In the incident ticket configuration, in standard ticket actions tab, ther is a close record i deactivated that and create a copy of that named'Close Permanently'.
In Close permanently I marked User input as true and saved it.
below a related list appeared,' standard ticket action inputs.
i created a record in that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
You will want to create a new UI action and disable the existing one. Here are some screen shots of the one I created in my PDI that worked for both the workspace and client.
Here's the code for the script:
function IncComplete() {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass('glide_confirm_basic');
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setPreference('title', new GwtMessage().getMessage("Are you sure you want to close this ticket?"));
dialog.setPreference('onPromptComplete', SNcompleteCallbackFunction);
dialog.render();
}
function SNcompleteCallbackFunction() {
gsftSubmit(null, g_form.getFormElement(), 'close_incident');
}
current.incident_state = IncidentState.CLOSED;
current.state = IncidentState.CLOSED;
current.update();
gs.addInfoMessage("Incident completed.");
Here's the code for the Workspace Script:
function onClick(g_form) {
var title = getMessage('Confirmation');
var message = getMessage("Are you sure you want to close this ticket?");
g_modal.confirm(title, message).then(
function onSuccess() {
g_form.submit('close_incident');
}
);
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
This is working for native ui and workspace. but not on employee portal. for that in standard ticket configurations will have to do something.but havent worked on it before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Ah. Sorry. I was thinking the EC was a workspace, but it's a portal. You will have to customize a widget for that, as others have suggested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @sharmaprash
- Navigate to Service Portal > Widgets and open the widget used for your ticket header/actions.
- Find the client script associated with the button and add a JavaScript confirmation box
refer:
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti