How to combine an advanced reference qualifier with a simple encoded query

Brett14
Giga Expert

Community,

I need to update our assignment group reference qualifier for Change Management.  Obvisouly I will need to do a dictionary override so that it is just for Change.

Can I do this below

javascript:new BackfillAssignmentGroup().BackfillAssignmentGroup() + typeNOT LIKE0c32e84cdbc95300ec5a70c08c961979

I am getting all the assignment groups now.

13 REPLIES 13

Mark Stanger
Giga Sage

You should just be able to use the '^' symbol to concatenate your string on to the end of the string being returned currently...

javascript:new BackfillAssignmentGroup().BackfillAssignmentGroup() + '^typeNOT LIKE0c32e84cdbc95300ec5a70c08c961979';

Hi Mark,

The list is coming up blank when selecting from assignment group

Go to a standard list and test your filter manually to see if it works there.  You can also modify your 'BackfillAssignmentGroup' script include to log out the query string it's returning.  If you can post that here, it might give me a better idea of where things are breaking.

We are using the basic BackfillAssignment group script include that ServiceNow provides as an example in the Product Documentation. Yes, if I go to the groups table list and yes the filter works there.  Basically show me groups that do not contain 'approval'. 

Script include below:

var BackfillAssignmentGroup = Class.create();
BackfillAssignmentGroup.prototype = Object.extendsObject(AbstractAjaxProcessor, {

BackfillAssignmentGroup:function() {
var gp = ' ';
var a = current.assigned_to;

//return everything if the assigned_to value is empty
if(!a)
return;
//sys_user_grmember has the user to group relationship
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('user',a);
grp.query();
while(grp.next()) {
if (gp.length > 0) {
//build a comma separated string of groups if there is more than one
gp += (',' + grp.group);
}
else {
gp = grp.group;
}
}
// return Groups where assigned to is in those groups we use IN for lists
return 'sys_idIN' + gp;
},
type: 'BackfillAssignmentGroup'
});