need to make assignment group visible to only specific group members only.

bhupendra paree
Tera Contributor

Hello All,

 

I want to hide an assignment group for specific groups members (so that they cant assign tickets to my group) or 

 

in other words, I want to make an assignment group visible to a specific group members only and not every one other than those members. 

 

How can i achieve it (for any form - assignment group field value), please advise.

3 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@bhupendra paree 

you can use advanced ref qualifier on that field

something like this

javascript: var query = ''; if(gs.getUser().isMemberOf('Group A')) query = 'sys_id!=groupSysIdYouWantToHide'; query;

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Subham Mundra1
Tera Expert

Hi @bhupendra paree ,

 

You can modify and use the below code in your "Assignment Group" advanced reference qualifier:-

 

javascript&colon; (gs.getUser().isMemberOf("<group name who should see all the groups>")) ? 'active=true' : 'active=true^sys_id!=<sysId of the group you want to hide>' ;

 

If you find this helpful, mark my answer helpful.

 

Regards,

Subham

View solution in original post

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @bhupendra paree ,

Use below script include and dictionary override :

Script Include :

var assignmentGroupRestrictions = Class.create();
assignmentGroupRestrictions.prototype = {
    initialize: function() {
    },
	
	hideAssignmentGroup : function (){
		if (gs.getUser().isMemberOf('Database') || gs.getUser().isMemberOf('Software')){ //Enter group names here from which you wanted to hide the assignment groups
		return 'sys_id!=477a05d153013010b846ddeeff7b1225^sys_id!=019ad92ec7230010393d265c95c260dd'; //Copy encoded query from group table by entering sys_id of groups which you don't want to show at assignment group level. (Make query as sys_id is not 477a05d153013010b846ddeeff7b1225 AND sys_id is not 019ad92ec7230010393d265c95c260dd)
		} 
	},

    type: 'assignmentGroupRestrictions'
};

 

GunjanKiratkar_0-1693415198839.png

 

Override Reference Qualifier :-

GunjanKiratkar_1-1693415237397.png

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@bhupendra paree 

you can use advanced ref qualifier on that field

something like this

javascript&colon; var query = ''; if(gs.getUser().isMemberOf('Group A')) query = 'sys_id!=groupSysIdYouWantToHide'; query;

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Its not working .Actually i need to make it visible for a specific group only and hide for all others
can you suggest best way to achieve it 

Subham Mundra1
Tera Expert

Hi @bhupendra paree ,

 

You can modify and use the below code in your "Assignment Group" advanced reference qualifier:-

 

javascript&colon; (gs.getUser().isMemberOf("<group name who should see all the groups>")) ? 'active=true' : 'active=true^sys_id!=<sysId of the group you want to hide>' ;

 

If you find this helpful, mark my answer helpful.

 

Regards,

Subham

bhupendraparee_0-1693414447407.png

How can i add/utilise your code when we already have some script include getting called in ref. qualifier , please advise