- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2025 03:32 AM
We have hidden incidents from all users and made only visible to "Desktop support" group members.
Now , We have requirement to make incidents visible to the user selected in "Requested For" variable on record producer.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2025 05:08 AM
Try below code-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2025 03:45 AM
Hi @VanishreeG
I believe you've used "Deny Unless" ACL to acheive your 1st requirement.
If yes, then you should update the script conditon on the same ACL.
Also the "requested for" variable musted be mapped to one of the fields on the incident table, like Affected caller/caller.
So in your script block write the below script,
var caller_id = current.getValue('caller');
var current_user = gs.getUserID();
if (gs.getUser().isMemberOf('Desktop support') || caller_id == current_user) {
answer = true;
} else {
answer = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2025 03:53 AM
We used before business rule to hide the incidents for Desktop support group.
Could you give more details about ACL script for the Incidents visible to the user selected in "Requested For" variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2025 03:57 AM
Could you share the pic of the BR script? It'll be helpful to review and modify.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2025 04:01 AM
(function executeRule(current, previous) {
var arr1 = [];
// Get the RITMs with the specific cat_item
var grInc = new GlideRecord('incident');
grInc.addEncodedQuery('assignment_group=4555877785868');
grInc.query();
while (grInc.next()) {
arr1.push(grInc.sys_id.toString()); // Store the sys_id of the inc in the array
}
var reqFor = gs.getUserID(); // Get the current user
var currentUser = gs.getUser();
if (!currentUser.isMemberOf('desktop support')) {
var encodedQuery = 'sys_idNOT IN' + arr1.join(',') + '^ORopened_by=' + reqFor; // Filter by user who created the ticket
current.addEncodedQuery(encodedQuery); // Adding this encoded query to current to filter records
}
})(current, previous);