Visibilty of cases based on Groups
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 07:59 AM
Hi Team,
Can anyone help me on the below requirement.
I have one Parent Group as Group A-
Child groups are Group A1,Group A2 and Group A3
I want members of Group A should be able to see all the cases assigned to Group A1,Group A2 and Group A3
But,members of Group A1/Group A2 should see only tickets assigned to them ,they should not be able to see cases assigned to Group A.
Thanks,
Karan
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 09:13 AM
Hi @KARAN24
Before Query it is possible. Before query business rule used on case table.
Please use below code
*****************************************************************************************************
(function executeRule(current, previous /*null when async*/ ) {
var grpGroup;
var member = [];
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('user', gs.getUserID());
grmember.query();
if (grmember.next()) {
var grpGroup = grmember.group;
}
gs.addInfoMessage("Grouppp---" + grpGroup);
if (grpGroup == 'bd561e1e47e43110a806afb8036d4315' || grpGroup == 'a4a61e1e47e43110a806afb8036d4336')// here put sys_id of GroupA1 and GroupA2 {
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", grpGroup);
gr.query();
while (gr.next()) {
gs.addInfoMessage("In ifff of Group---");
member.push(gr.user.toString());
}
gs.addInfoMessage("member---"+member); // only member of GroupA1 or GroupA2
current.addEncodedQuery('u_assigned_toIN' + member); // assigned to field on your case table
}
})(current, previous);
***********************************************************************************************************
Here we can not consider GroupA hence for GroupA it will show all cases.
Please check and Mark Helpful and Correct if it really helps you.