
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 07:08 AM
I want to separate groups that handle Incidents so that the ITIL user in each groups only see their incidents. I didn't want to play with the ACL so I updated the business rule "incident query " (see below). The business rule is working after some initial tests and showing me only the incidents for the groups the user is in.
However, I am wondering where is the sys_id ("d6435e965f510100a9ad2572f2b47744") for this DYNAMIC coming from? I copied that query from the list when I set the filter. The value is the same as on my developer instance, test instance and production instance.
--------
Business rule: incident query
When: before
Order: 100
Query
No filter
----------------
// check if user is not the admin. admin can see everything
if (!gs.hasRole("admin")) {
var u = gs.getUserID();
// if user has ITIL role we check what groups the user belongs to and then run the query
if (gs.hasRole("itil") && gs.isInteractive()) {
var qc = current.addQuery("assignment_group", "DYNAMIC", "d6435e965f510100a9ad2572f2b47744");
gs.print("query restricted to users groups: " + u);
}
// if user is not itil we check only for the incidents for the user
if (!gs.hasRole("itil") && gs.isInteractive()) {
var qc = current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);
gs.print("query restricted to user: " + u);
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 07:10 AM
Dynamic filter i gguess,
Navigate to Dynamic filter from left nav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 07:10 AM
Dynamic filter i gguess,
Navigate to Dynamic filter from left nav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 07:49 AM
I am not sure I understand what you are trying got say? I got the value when I copy the query from the list into the script. I would like to find out to what table that sys_id is refering to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 07:50 AM
It should be a group, sys_user_group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 07:53 AM
The user can be in many groups and I found it.
It is in the table "sys_filter_option_dynamic".