- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 02:54 AM - edited 11-02-2023 02:57 AM
I am unable to see reopen button in the EC portal.
I read this one of the blogs:
In order to make the Reopen action visible according to your needs, you can choose to override this method in
canReopenIncident: function(current) { return current.incident_state == IncidentState.RESOLVED && !gs.getUser().hasRoles() && !this._isMajorIncident(current); }
But still unable to resolve it. I want anyone with an itil role or snc_internal role to be able to reopen the incident. How do I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 04:27 AM
Hi @vidhya_mouli ,
Go to the 'IncidentUtils' script include and add the canReopenIncident function with you requirements in line 6 of the script, it will be something like this :
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-02-2023 04:27 AM
Hi @vidhya_mouli ,
Go to the 'IncidentUtils' script include and add the canReopenIncident function with you requirements in line 6 of the script, it will be something like this :
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-02-2023 06:49 AM - edited 11-02-2023 06:49 AM
Thank you for your input. However, when I add this code to IncidenUtils, it completely removes the Action button. Not sure why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 06:56 AM
Hi @vidhya_mouli ,
If you send a screenshot, I can take a look. My guess would be to check if you have misspelled something. For example, if you are checking if the user has a role, like I did on mine, be careful not to use 'gs.getUser().hasRoles()' instead of 'gs.getUser().hasRole()'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 07:28 AM
I used this code:
var IncidentUtils = Class.create();
IncidentUtils.prototype = Object.extendsObject(IncidentUtilsSNC, {
initialize: function() {
IncidentUtilsSNC.prototype.initialize.call(this);
},
/***************Custom changes****************/
canReopenIncident: function(current) {
return current.incident_state == IncidentState.RESOLVED && gs.getUser().getRoles().length > 0 && !this._isMajorIncident(current);
},
type: 'IncidentUtils'
});