Business Rule to restrict visibility of Incidents to assignment group members, caller, watchlist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:21 AM
Requirement: Incidents that are assigned to "IT - Enhancements" to only be visible to members of the IT Enhancements assignment group, the caller, users on the watch list and admins. Other itil users cannot see these tickets unless the ticket is no longer assigned to IT - Enhancements group.
I have somewhat achieved this through a business rule before query to lock down to members of the IT - Enhancements group.
I now want to add Admin, Caller and Watch list to this, i have tried to add the following in the condition but this did not allow the caller to see the ticket in the portal
!gs.getUser().isMemberOf('IT - Enhancements') || current.caller_id != gs.getUser() || !current.watch_list.toString().split(';').includes(gs.getUser()
I tried without the watchlist and just had just current caller id
!gs.getUser().isMemberOf('IT - Enhancements') && current.caller_id != gs.getUser()
I have used OR || and also && but nothing seems to work to allow Caller, Watch list and Admin to see the ticket as well any help would be appreciated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:24 AM
Hi @Renee16
Can you check this-
!gs.getUser().isMemberOf('IT - Enhancements') && (current.caller_id != gs.getUserID() && (current.watch_list.nil() || current.watch_list.toString().split(';').indexOf(gs.getUserID()) == -1) && !gs.hasRole('admin'))
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:31 AM
Thanks for the quick response here are the results
Admin can see it now - good
Members of the group can see it - good
Other itil users cannot see it - good
Caller still cannot see the record
Users on the Watch List cannot see it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:44 AM
Hi @Renee16
Can you try this once-
!gs.getUser().isMemberOf('IT - Enhancements') &&(current.caller_id == gs.getUserID() || (current.watch_list.nil() || current.watch_list.toString().split(';').indexOf(gs.getUserID()) != -1) || gs.hasRole('admin'))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:54 AM
This one has made the ticket visible to all again including the other itil users who shouldn't have access.