To restrict the ability to resolve P1 (Priority 1) and P2 (Priority 2) incidents to only users in "Group-A" in ServiceNow, you can utilize a combination of Business Rules and Access Control Rules (ACLs). This ensures that only specified users have the necessary permissions to transition incidents of these priorities to a resolved state. Below are steps to achieve this:
Step 1: Define a User Group for Group-A
First, ensure that "Group-A" is clearly defined in your ServiceNow instance with the appropriate users added to it.
- Navigate to User Administration > Groups.
- Check if "Group-A" exists. If not, click "New" to create it and add users accordingly.
Step 2: Create an Access Control Rule (ACL)
Create an ACL to enforce the restriction on changing the incident state to resolved for P1/P2 incidents except for users in "Group-A".
- Navigate to System Security > Access Control (ACL).
- Click "New" to create a new ACL.
- For the Type, select "Record".
- For the Operation, choose "Write".
- For the Name or Table, select "Incident [incident]".
- Conditions: Specify conditions to match P1 and P2 incidents. This could look like:
[Priority] [is] [1 - Critical] or [Priority] [is] [2 - High]. You may need to create two separate ACLs for P1 and P2 if you cannot adequately define this in a single condition.
- Script: Use a script to check if the user is part of "Group-A". Below is a sample script you might use. Adjust "group_a_sys_id" to the actual sys_id of Group-A.
(function executeRule(current, previous /*null when async*/) {
// This gets the sys_id of the Group-A; replace 'group_a_sys_id' with actual sys_id
var groupASysId = 'group_a_sys_id'; // Example sys_id
var userGrpMember = new GlideRecord('sys_user_grmember');
userGrpMember.addQuery('group', groupASysId);
userGrpMember.addQuery('user', gs.getUserID());
userGrpMember.query();
if (userGrpMember.next()) {
// User is in Group-A, allow write
return true;
}
// If the code reaches here, the user is not in Group-A, prevent write unless read-only fields
return false;
})();
-
Conditions or Scripted Conditions: Use these if your conditions for Priority cannot be defined directly through the form fields provided.
-
Save the ACL.
Step 3: Test the Configuration
After setting up the ACL, test it by attempting to resolve P1/P2 incidents as a user that is both within and outside of "Group-A". Users not in "Group-A" should be unable to change the incident state to resolved for P1/P2 incidents.
Note:
Remember, directly manipulating ACLs can impact system performance and user experience. It's critical to thoroughly test these changes in a development or testing environment before applying them in production. Furthermore, consider consulting with a ServiceNow administrator or expert when making such changes to ensure best practices are followed and unintended access restrictions are avoided.