Assigned to users Should be dependent on Assignment Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 10:37 PM
Hi All,
The sc_task screen has two fields, Assignment Group and Assigned_To. I want to display users in the Assigned_To search based on the group selected in Assigned Groups.
Setting Assignment group in the Dependent Field of Assigned_To did not work.
I tried the following questions but it didn't work.
Please tell me how to do it.
thanks all
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 10:43 PM
Hi
Can you show your reference qualifier condition that you put in the assigned to field?
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 11:10 PM
Thank you for your reply
javascript:new UserGroup().getMembers(current.variables.asn_grp);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 11:18 PM
script include
var UserGroup = Class.create();
UserGroup.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getMembers : function(groupId){
gs.log("group",groupId);
var id = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery("group",groupId);
gr.query;
while(gr.next()){
id.push(gr.getValue("user"));
}
gs.log('sys_idIN+id.join();' +"sys_idIN"+id.join());
return "sys_idIN"+id.join();
},
type: 'UserGroup'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2020 12:03 AM
Hi
Updated the script include code, also, are those variables of a catalog item?
var UserGroup = Class.create();
UserGroup.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getMembers : function(groupId){
gs.log("group",groupId);
var id = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery("group",groupId);
gr.query;
while(gr.next()){
id.push(gr.getValue("user"));
}
gs.log('sys_idIN+id.join();' +"sys_idIN"+id.join());
return "sys_idIN"+id.toString();
},
type: 'UserGroup'
});