- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 09:27 PM
Hi,
I created a before query business rule to restrict ticket visibility to only users in their groups. I have 3 custom tables so this works perfectly to show the tickets you have access to based on the assignment group you're in. However, I get an error from 2 of the tables when I submit a record producer that uses those 2 tables. The other table works fine. When I disable this business rule, I can see the records I submitted but users will lose that restriction and can see ALL tickets, which is not what I want. Here is my script:
(function executeRule(current, previous /*null when async*/) {
var u = gs.getUserID();
if((!u.isMemberOf(current.assignment_group)) && gs.getSession().isInteractive()){
var q = current.addQuery('assignment_group', getMyGroups());
}
})(current, previous);
What is wrong with my code? How do I allow users to see the records they submitted for the other 2 tables?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 09:57 PM
Hi Abhay,
what do you mean it allows all records? My script works fine to show only tickets that are assigned to a person's group. But I am having problems viewing the ticket from the Service Portal after it is submitted because of the error I posted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 09:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 09:57 PM
Hi Abhay,
what do you mean it allows all records? My script works fine to show only tickets that are assigned to a person's group. But I am having problems viewing the ticket from the Service Portal after it is submitted because of the error I posted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2022 10:45 PM
I found my answer. I need to add ("requested_by",u) to my query to allow users to see tickets they submitted.