Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2018 07:57 AM
If I correctly understand your question then you can add one more method, for example, with the name filterUsersOnGroup, which parameter is the sys_id of the group, chosen in assignment_group. The Reference qual of "Assigned to" field could be:
javascript:new BackfillAssignmentGroup().filterUsersOnGroup(current.assignment_group)
The code of filterUsersOnGroup could be the following
var BackfillAssignmentGroup = Class.create();
BackfillAssignmentGroup.prototype = {
initialize: function() {
},
// Filter out groups that are not the provided type
filterGroupsonUser: function(cUser) {
... // your old code
},
filterUsersOnGroup: function(group) {
if (!group) {
return;
}
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group', group);
gr.query();
var users = [];
while (gr.next()) {
users.push(gr.user);
}
return users.length > 0 ? 'sys_idIN' + users.join() : undefined;
},
type: 'BackfillAssignmentGroup'
}