How to give a warning pop up to the incident caller before they click the close button on EC

sharmaprash
Tera Expert

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.

sharmaprash_0-1782146045076.png

 

2 ACCEPTED SOLUTIONS

JenniferRah
Mega Sage

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.

 

JenniferRah_0-1782152911175.png

JenniferRah_4-1782153086781.png

 

JenniferRah_3-1782153075815.png

 

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;
}

 

 

View solution in original post

sharmaprash
Tera Expert

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 

sharmaprash_0-1782197744182.png

 

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron

@sharmaprash 

why to have this much customization?

You can train your end users about this

If you still want then you need to clone the OOTB widget, make changes to it and then add that widget again to your portal page

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

sharmaprash
Tera Expert

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 

sharmaprash_0-1782197744182.png