
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 02:25 PM - edited 11-17-2023 05:13 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 03:16 PM - edited 11-14-2023 03:18 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 04:46 AM
@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
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader