- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 04:56 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 04:59 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 09:13 AM
Hi @bhupendra paree ,
You can modify and use the below code in your "Assignment Group" advanced reference qualifier:-
javascript: (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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:07 AM
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'
};
Override Reference Qualifier :-
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 11:59 AM
This seems to be referring to a script include, which will return a encoded query after running few logics. you can try and incorporate the mentioned code snippet in the existing script include. The code snippet I have mentioned is nothing but an IF statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:07 AM
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'
};
Override Reference Qualifier :-
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:16 AM
Solution seems to be perfect but i need to make Asgn.Group-A invisible to all other groups except few selected groups(e.g. B and C). i.e. for B and C group members only , Group A should be visible .
Putting all existing groups which should be restricted in if condition is not feasible, i think.
How can we overcome this , please advise.