How to restrict group members not to see other category incidents

Talari Balateja
Tera Expert

Hi,

 

Currently I have stucked in one point.

 

if the incident category is IT Infrastructure, then it should be visible to particular group (monitoring, delivery team) other categories should not be visible to these groups.

 

Regards,

Balateja.

12 REPLIES 12

Vishwa Pandya19
Mega Sage

Hi Talari,

 

You will need to write a Before Query Business Rule to achieve this.

 

Condition:

gs.getUser().isMemberOf('group name')

 

Script:

var a = current.addQuery('category''IT Infrastructure');
 
If my answer helped you in any way please mark it as correct.

@Vishwa Pandya19 

 

I have tried but it's not hiding from other groups.

 

condition: gs.getUser().isMemberOf('Delivery Team') || gs.getUser().isMemberOf('Monitoring Team')

 

(function executeRule(current, previous /*null when async*/ ) {
 
    var grp = current.addQuery('contact_type', 'phone');
 
})(current, previous);

Hi Talari,

 

Have you ensured that any one condition is being fulfilled?

If you are testing yourself, then you need to be part of any one of the mentioned group. If not then you'll have to impersonate and check.

The same script is running fine on my instance.

 

If my answer helped you in any way please mark it as correct.

Deepak Shaerma
Kilo Sage

Hi @Talari Balateja 

the simple way to do it using configuring Access Control Rules (ACLs) and possibly using Business Rules also.
just follow these steps  System Security > Access Control (ACL)> New> Operation to read 

 

// Check if the category is ‘IT Infrastructure’
        if (current.category == 'IT Infrastructure') {
            // Allow visibility if user is in ‘monitoring’ or ‘delivery’ group
            return gs.getUser().isMemberOf('monitoring') || gs.getUser().isMemberOf('delivery');
        } else {
            // Hide for other categories
            return false;
        }

 

Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning ‌‌
Thanks & Regards 
Deepak Sharma