- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2022 04:59 PM
So here is an example I found and slightly massaged already:
if(!gs.getUser().isnotMemberOf('sys_id')){ //sys_id of group to check if user is a member of
current.addQuery('sys_id','!=','sys_id_of_group_to_hide');
}
(In that example, I changed !gs.getUser().isMemberOf('sys_id') to .isnotMemberof and it seems to work as an option)
I'm editing the script under Business Rules > group query that uses the Group [sys_user_group] table. I left the default JavaScript alone: if (!gs.hasRole("admin") && gs.getSession().isInteractive()) {current.addQuery("active", "true");} (edited here to be on one line).
I'm trying to get two of our groups to not get tickets back assigned to them, essentially I need them to not show up on the Assignment Group dropdown of other groups. Currently if I use just this line of code and put in the sys_id of one of GroupA in the top argument, and put sys_id of GroupB in the spot of sys_id_of_group_to_hide that group becomes invisible to anyone except GroupA, including anyone in GroupB, so, not ideal.
So what I'm asking for help here is how to I make it so that GroupA and GroupB see all the groups on the dropdown menu, but the other groups don't see GroupA or GroupB. I feel I'm close, but I don't have the coding experience to get this nailed down.
All help is greatly appreciated!
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 04:27 PM
Hi Lee,
As per my understanding of your requirement, you can create an onDemand function using Script Include, and call it in the Override reference qualifier for assignment_group field of incident table.
For reference see the below images.
Hopefully, this will help you resolve your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 03:50 AM
Not sure how far you are already, but please don't use the Query BR for this. That will work on the groups list as well!
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 10:09 AM
Well I don't think I've done any Query Business Rules on this anymore, I've removed any test scripts that were in my original question and moved on to trying the suggested answer first given. I definitely ran into that problem where the groups "disappeared" on my groups list
I added your script and it looks like it works Mark, thank you!