
- 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-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:24 AM
Hi Clara,
Thank you so much. Quick question, Can I edit the "if" statement to hide the close button. for example, once the non-admin user resolves their ticket the "close" button never shows up. it only shows up for an admin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 06:58 AM
Thanks Clara, the code worked great.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 04:40 AM
Hi @Edward Rosario ,
The code above will only return true if it is resolved and the user is an admin.
Let me know what is not working for you 🙂