Allow only Major Incident Manager to modify incident priority of accepter major incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 07:02 AM
Hello!
My team is looking to find a way to allow only Major Incident Managers to adjust the priority of an incident once it has been proposed and/or accepted as a major incident.
Based on some previous searches, it seems like a business rule would be one way to go about accomplishing this, but I am not sure what filter condition or script would be best utilized here.
Any input/guidance would be greatly appreciated! Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 08:00 AM
Hi @josh_oman,
The best practice for controlling access to fields/data is via ACL's (Access Control Lists).
You'll need to elevate your role as an admin and edit/create (depending on the current ACL's already implemented) an ACL for both the urgency and impact fields (Seeing as they control the overall priority - again assuming you've maintained the OOB configuration).
With regards to your filter, it should be as simple as checking whether the major incident state is either Accepted or Proposed vs being empty (or any other state).
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 11:37 AM
Good Afternoon @Robbie!
Apologies for the delay in responding to your post! Do you have a sample ACL/screenshots that could be used to achieve this? I do not have the ability to elevate my role in ServiceNow and therefore cannot create or edit any ACL's (I would need to work with a member of our admin team to try and accomplish this using ACL's).
Is there any other means by which this can be accomplished? I see a few forum posts out there suggesting to use a business rule, but am not familiar enough with scripting in ServiceNow to modify something like this BR script from Deepak Shaerma to make it work for major incident state instead of priority:
(function executeRule(current, previous /null when async/) {
// Check if priority is P1/P2 and there is an attempt to resolve the incident
if ((current.priority == ‘1’ || current.priority == ‘2’) && current.state == ‘Resolved’) {
var userGrp = new GlideRecord(‘sys_user_grmember’);
userGrp.addQuery(‘user’, gs.getUserID());
userGrp.addQuery(‘group.name’, ‘Major Incident Management Team’);
userGrp.query();
// If the current user is not a member of the Major Incident Management Team, prevent resolution
if (!userGrp.hasNext()) {
current.setAbortAction(true); // Prevents the update from going through
gs.addErrorMessage(‘Only members of the Major Incident Management Team can resolve P1/P2 incidents.’);
}
}
})(current, previous);