Before Query Business Rule Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 05:44 PM
Hello,
I am looking to create a before business rule query that involves only snc_internal users. We have different departments that require access to incidents when a user from either department A or department B submits an incident with a specific category on our service portal. We attempted the a read ACL route and is populating the correct data, but is very clunky for the end users. They have to sift through pages of incidents where it tells the user that "10 records have been restricted" etc. I think a before business rule query with the same condition would be a better approach. The issue is that we would have to build this condition based on department. My thought was to clone the OOB "Incident Query" and alter the condition based on our requirements.
Any guidance on how to script this by department would help tremendously. Any other tips or insight on other methods to achieve this goal would also be welcomed.
Thanks
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 06:00 PM
Hi
as you did not provide enough details, I cannot answer your question.
But you can watch the following video to get an idea on how to implement a respective Before Query Business Rule.
https://www.youtube.com/watch?v=Xtj9nvnryr8&list=PLkGSnjw5y2U5jTsF7i2yRZPdk3lm88SN8&index=26
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2022 03:56 AM
Hi, consider to use the script below (to be added to the advanced tab of Before Query BR).
It forces users from HR and IT departments to only see incidents, raised for Software category and by callers from either Finance or Product management departments.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (userIsInDepartments()) {
current.addEncodedQuery('caller_id.department=a581ab703710200044e0bfc8bcbe5de8^ORcaller_id.department=9a7ed3f03710200044e0bfc8bcbe5db7^category=software');
}
function userIsInDepartments() {
var gr= new GlideRecord('sys_user');
gr.get(gs.getUserID());
if (gr.department.name.toString()=='HR' || gr.department.name.toString()=='IT')
return true;
}
})(current, previous);
Hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2022 09:41 AM
Thanks for the quick and detailed response. I have tried this method and was not successful on our instance. I think we are still having conflicts with OOB incident Business Rules. The users in question here do not have roles associated with their accounts, only snc_internal. So I think we are limited to what can be accomplished when viewing other department records. We will keep troubleshooting.
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2022 11:03 AM
Hi, agree - but if it is about viewing records, consider to apply ITSM specific role sn_incident_read to these users; it should grant them an access to incidents however BR will still restrict an access as per script above.
Hope it helps