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
03-18-2019 09:23 AM
just put this in your condition. assignment_group!=it-snow
You don't need javascript: at the beginning.
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 10:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 11:49 AM
Hi Prateek,
I have tried the way you have explained it to me and it did not work . can you please help me as this is not yet resolved.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 01:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 02:14 PM
Agree