- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 07:33 AM
Hi All ,
I have a requirement to hide the records based on the assignment group and i have assignment group " A " and if the user is part of that group he has to see the only the tickets assigned to that group ( A) and if the user is part of any another group they dont want to see the records that assigned to that assignment group (A) . Admin has to see the all the records irrespective of any groups .
I have return the query Br to hide them .Please find the script below .
Note : Admin role user can see all the records and users part of group A has to see only the tickets assigned to that group . If the user part of deferent group he should not see the tickets assigned to group A.
Script :
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 10:31 AM
@sushma9 Simply replace your script with the following.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(!gs.hasRole('admin')){
current.addEncodedQuery('assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744');
}
})(current, previous);
Please mark the answer correct and helpful if it addresses your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 07:45 AM
Hi All,
when i am changing the script i am getting below result
Script :
Please let me know if anything has to be modified in the script section.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2023 10:31 AM
@sushma9 Simply replace your script with the following.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(!gs.hasRole('admin')){
current.addEncodedQuery('assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744');
}
})(current, previous);
Please mark the answer correct and helpful if it addresses your issue.