- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 12:48 PM - edited 01-13-2023 01:53 PM
Hello,
I have a business requirement to restrict visibility of cases in payroll groups to only members of those groups. Easy enough -- where I'm running into trouble is making sure the cases are still visible for the employee Opened_For.
I started by writing the below script,
(function executeRule(current, previous /*null when async*/) {
var currentUser = gs.getUser();
var isMemberAPAC1 = currentUser.isMemberOf('043b5d3e475ddd18fe88645f746d436f'); // HR Payroll APAC 1
var isMemberAPAC2 = currentUser.isMemberOf('9e3bddfe475ddd18fe88645f746d4375'); // HR Payroll APAC 2
var isMemberAPAC3 = currentUser.isMemberOf('5240a214471fdd50fe88645f746d435e'); // HR Payroll APAC 3
if(isMemberAPAC1 == false) {
current.addQuery('assignment_group', '!=', '043b5d3e475ddd18fe88645f746d436f'); //HR Payroll APAC 1
}
if(isMemberAPAC2 == false) {
current.addQuery('assignment_group', '!=', '9e3bddfe475ddd18fe88645f746d4375'); //HR Payroll APAC 2
}
if(isMemberAPAC3 == false) {
current.addQuery('assignment_group', '!=', '5240a214471fdd50fe88645f746d435e'); //HR Payroll APAC 3
}
})(current, previous);
but I'm not sure how to exempt/modify the query so cases where
currentUser = case.opened_for
are not hidden. Has anyone encountered a scenario like this? Any help is appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 02:40 PM
Marking this as resolved -- I found the solution and it involved rethinking the and/or statement and using an encoded query!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 02:40 PM
Marking this as resolved -- I found the solution and it involved rethinking the and/or statement and using an encoded query!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 09:56 PM
Can you please provide the whole Solution