Restrict incident tickets based on the group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2024 09:48 PM
Hello,
we have created the three groups like Blue green and yellow and my requirement is green group can able to see both yellow group and blue group tickets.
2. Blue group should not see green group tickets but they can see yellow group tickets
3. Yellow Groupcan see both blue group and green group ticket
How to acheive this..?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 04:42 AM
By any chance, you are in domain separated instance? If no, then use ACL or BR to make these restrictions.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 04:48 AM
you can use query business rule on your table and handle this
what script did you start with and where are you stuck?
Something like this but please enhance it further
(function executeRule(current, previous /*null when async*/) {
// Get the current user's groups
var userGroups = gs.getUser().getMyGroups();
var groupNames = [];
while (userGroups.next()) {
groupNames.push(userGroups.name.toString());
}
// Define the group visibility rules and give the sysIds of those 3 groups
var greenGroup = 'Green Group SysId';
var blueGroup = 'Blue Group SysId';
var yellowGroup = 'Yellow Group SysId';
// Build the query based on the user's group membership
var query = '';
if (groupNames.includes(greenGroup)) {
query = 'assignment_group.nameIN' + blueGroup + ',' + yellowGroup + ',' + greenGroup;
} else if (groupNames.includes(blueGroup)) {
query = 'assignment_group.nameIN' + blueGroup + ',' + yellowGroup;
} else if (groupNames.includes(yellowGroup)) {
query = 'assignment_group.nameIN' + blueGroup + ',' + greenGroup + ',' + yellowGroup;
} else {
query = 'assignment_group.nameIN' + blueGroup + ',' + yellowGroup; // Default to blue and yellow if no specific group
}
// Apply the query
current.addEncodedQuery(query);
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 10:20 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader