Restricting Incident Records Visibility to Specific Assignment Groups Using Business Rules

Restricting Incident Records Visibility to Specific Assignment Groups Using Business Rules

Overview

In ServiceNow, you might need to restrict visibility of incident records so that a specific group, for our example we created a Dispatch group and added members to it, members of Dispatch group can only view incidents assigned to their own group or those where the assignment group is null. This article provides a step-by-step guide on how to achieve this using a Business Rule.

Objective

The goal is to configure the Business Rule so that members of the “Dispatch” group can only see incident records where the assignment group is either “Dispatch” or null.

Steps to Create the Business Rule

  1. Navigate to Business Rules
    • Go to System Definition > Business Rules in the ServiceNow application navigator.
    • Click on New to create a new Business Rule.
  2. Configure the Business Rule

Basic Information:

    • Name: Restrict Dispatch Group Incident Visibility
    • Table: Incident [incident]
    • Advanced:true
    • When: Before
    • Query: true

In the Advanced tab, use the following script to enforce the visibility restriction:

condition field : gs.getUser().isMemberOf(‘Dispatch’)

Script :

(function executeRule(current, previous /*null when async*/ ) {

// Add your code here

current.addNullQuery(‘assignment_group’).addOrCondition(‘assignment_group’, 9d5c414a8331121084c65d10feaad36a);

})(current, previous);

Note : 9d5c414a8331121084c65d10feaad36a is sys id of dispatch group

Explanation:

    • This script checks if the current user is a member of the “Dispatch” group.
    • If the user is a member, it restricts the visibility of incidents where the assignment group is ‘Dispatch’ or null.
  1. Save the Business Rule
    • Click Submit to save the Business Rule.

Testing the Configuration

  • Log in as a member of the “Dispatch” group and try to access various incident records.
  • Verify that you can only view incidents where the assignment group is ‘Dispatch’ or null. Ensure that incidents with different assignment groups are not visible.

Conclusion

By creating and configuring this Business Rule, you can effectively control the visibility of incident records for the “Dispatch” group in ServiceNow. This approach helps ensure that users see only the records relevant to their role, maintaining data security and relevance.

For further customization or troubleshooting, consult the ServiceNow documentation or seek assistance from a ServiceNow expert.

 

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *