Script Include to filter assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2018 09:51 AM
Hello,
I'm trying to filter the reference available on the assignment group.
I was reading about reference qualifiers but I can't seem to add a condition to them. What i'm trying to do is, whenever an incident has 'test company' as the company, it will filter the assignment group to a specific group based to that company. I established a reference between the two tables, but I was wondering what would be the best approach. I'm thinking its probably a script include, but any insight would be helpful. Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2018 10:13 AM
Hi,
Not sure but try applying Advanced reference qualifier on Assignment Group reference field and add javascript:current.company;
Regards,
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2018 11:19 AM
This is what I have this far:
var BackfillAssignmentGroup = Class.create();
BackfillAssignmentGroup.prototype = {
initialize: function() {
},
BackfillAssignmentGroup:function() {
var gp = '';
var company = current.company;
var domain = current.domain;
if(!company)
return;
var grp = new GlideRecord('sys_user_group');
//grp.addQuery('u_company',company);
grp.addQuery('company', company);
grp.query();
while(grp.next()) {
if (gp.length > 0) {
gp += (',' + grp.getUniqueValue());
}
else {
gp = grp.getUniqueValue();
}
}
return 'sys_idIN' + gp;
},
type: 'BackfillAssignmentGroup'
};
I realized that I need to filter by domain as well. If the domain on the company matches the assignment group. I'm trying to figure out how to compare them.