Restrict assignment group field only for Service Desk

TomG2
Tera Contributor

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!

6 REPLIES 6

SarthakGoel
Tera Expert

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

Tai Vu
Kilo Patron
Kilo Patron

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&colon;new CLIncidentUtils().getGroupReferenceQual();

 

 

Cheers,

Tai Vu

TomG2
Tera Contributor

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:

TomG2_0-1700828883031.png

 

My reference qualifier:

TomG2_1-1700828967076.png

 

 

Have I made any mistakes?

 

Thanks again

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