Users should not be able to close tickets from employee center

Edward Rosario
Mega Sage
Mega Sage

From my Tickets a user can Resolve an incident (this is OK),  but once resolved they can then Close a resolved incident. 

This should not be allowed, closing should only be done by admins or the system.  Where can I edit this to meet the above criteria?

1 ACCEPTED SOLUTION

Clara Lemos
Mega Sage
Mega Sage

Hi @Edward Rosario ,

 

You can navigate to the Script Includes table and open this one: 'IncidentUtils'

If you verify the code in there you can add below the comment : /***************Custom changes****************/

The function canCloseIncident, in this function you should add the condition to show the "close" option. 

You probably are looking for something like below 🙂 

 

var IncidentUtils = Class.create();
IncidentUtils.prototype = Object.extendsObject(IncidentUtilsSNC, {
    initialize: function() {
        IncidentUtilsSNC.prototype.initialize.call(this);
    },

    /***************Custom changes****************/
    canCloseIncident: function(current) {
        if (current.incident_state != IncidentState.RESOLVED)
            return false;
        if (gs.hasRole("admin"))
            return true;
        return false;
    },

    type: 'IncidentUtils'
});

 

 

 

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers

 

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Edward Rosario 

@Clara Lemos has already pointed out the function which controls the visibility

I would like to highlight the widget which shows the button and how it's invoking the script include

Name of widget: Incident Standard Ticket Actions

 

AnkurBawiskar_0-1700052346834.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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