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-16-2023 05:46 PM
Hi @TomG2,
You can use the dynamic reference qualifier option and then call the Script Include from that.
In the script Include, you can check if the logged-in user is a member of the service desk.
If this condition is true then return the reference qualifier query excluding the group 2 name
If the condition is false then you can return your normal query.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response helpful.
Thanks
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 01:54 AM - edited 11-17-2023 01:55 AM
Hi @TomG2
You can define a function in a script include, then call that function in the reference qualifier of the assignment group field.
Sample below.
#Script Include
var CLIncidentUtils = Class.create();
CLIncidentUtils.prototype = {
initialize: function() {},
getGroupReferenceQual: function() {
var query = 'active=true'; //replace your default query here
if (gs.getUser().isMemberOf('Service Desk')) {
query += '^sys_id!=<the_sys_id_of_management_group>'; //Management
}
return query;
},
type: 'CLIncidentUtils'
};
#Reference Qualifier
javascript:new CLIncidentUtils().getGroupReferenceQual();
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 04:29 AM
Hi,
Thanks for your help. But when testing this, it doesn't seem to work. I've put the groups sys ID where you suggested and copied the reference qualifier exactly but it has made no difference.
My script include:
My reference qualifier:
Have I made any mistakes?
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 04:14 PM
Hi @TomG2,
Please remove < and > in line number 8 so that it will be something like below.
query += '^sys_id!=da01xxxxxx';
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response helpful.
Thanks
Sarthak