Restrict assignment group field only for Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 08:09 AM
Hi all,
I'm trying to restrict the Service Desk from seeing 1 specific group in the assignment group field and I'm not sure exactly how to go about this.
I managed to make it so service desk can only see that group using the reference qualifier but thats the exact opposite of what i'm looking for.
So for example
Group 1: Service Desk
Group 2: Management
I want group 1 to be able to select any group in the assignment group except group 2.
Any help would be appreciated,
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 01:17 AM
Even when removing the "<>", it is still not working unfortunately
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 07:02 PM
Hey @TomG2
Just remove these characters out "<>". Your function should be like below.
getGroupReferenceQual: function() {
var query = 'active=true'; //replace your default query here
if (gs.getUser().isMemberOf('Service Desk')) {
query += '^sys_id!=da01db8b1bab6300f17ddc65bd4bcb40'; //Vendor
}
return query;
},
You can also apply the condition right inside the reference qualifier in dictionary.
Sample below.
javascript: (gs.getUser().isMemberOf('Service Desk')) ? "sys_id=da01db8b1bab6300f17ddc65bd4bcb40" : "active=true";
You can also store the sys_id in a system property to avoid hard-coding. Just use the API below to get the property value.
gs.getProperty("<your_system_property_name>");
Cheers,
Tai Vu