I have to write a script include to exclude the Assignment group from choosing the user .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 07:37 AM
Hi All,
I have to write a script include to exclude the Assignment group from choosing the user .
I am going to call this script include function in the reference qualifier .
Assignment group is a reference type field
Below is the script include i have created but it is not working accordingly . I am not sure how to exclude that one group and return all the other group as it is in that assignment group field .
var Hide _groups = Class.create();
Hide_ groups.prototype = {
filters1: function() {
//Quering on group
var gr = new GlideRecord('sys_user_group');
gr.addQuery('name',XYZ); // XYZ is the name of the assignment group .This is the only group i am trying to exclude showing from the list
gr.query();
var qry =[];
while(gr.next()){
qry.push(gr.sys_id.toString());
}
else qry.push(gr.sys_id.toString());
}
},
type: 'Hide _groups'
};
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2021 11:06 PM
Hi
I Have one catalog item which is "user management add/remove/modify catalog item" in this catalog item we have one field is there which is "Are you part of AIS" This field has two choices (yes, No) whenever we are selecting the "yes" option then one field is visible
Are you part of AIS?
yes
NO
user | groups Type of change |
all dropdowns are choices.
Based on the field I want to visible groups list. for example (Are you part of AIS? is "yes" then here is it is visible only AIS-related groups), (Are you part of AIS? is "NO" then here is it removes all parent groups and PPO G groups)
please help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 08:06 AM
Why would you even need a script include.
In the reference qualifier just add the condition, Name--is not -- Your group name.
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 08:47 AM
Hi Praeek,
I tried this way but it is not hiding the group on the UI level.
javascript:assignment_group.name!*groupname --- Groupname is the group i am trying to hide it .
javascript:assignment_group.nameNOT LIKEgroupname ---
Groupname is the group i am trying to hide it .
Tried both ways but did not work .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 08:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 09:03 AM
I used this as well
javascript:assignment_group.name!=groupname //Groupname is the group i am trying to hide it.
I am not doing this in the assignment group field --> Reference specification.
I am using this script under the same field where directory overrides have tables with reference to this field.
See below i am placing script there .