Reference qualifier not to show few sys_ids

Divya57
Tera Expert

Hi Team,

i have one requirement, in List collector type variable i need show few list of servers(cmdb_ci_server) based on user part of that group. Suppose server support group is xyz and catalog requested for user is part of xyz group then those servers visible to them. This one part am able to achieve this part perfectly working with below code in reference qualifier.

javascript: new UserUtileCustom().getUserGroups(current.variables.requested_for);

Till here its working perfectly. Another condition i need to add here is, i have one custom table called ‘Node runner(u_node_runner)’. If above server is part of in this ‘Node runner’ table, then that server, should not shown in ‘list collector’ variable. The node runner form as cmdb_ci reference field.

i created a one script include function am getting sysids from node runner table, but not able to achieve, how not show these records in list collector variable.

below script include used

 

getTidaljob: function {

var arr = [];

var gr = new GLideRecord ('u_node_runner ');

gr.addEncodedQuery ('operational_status=1^support_groupDYNAMICd6435e965f510100a9ad2572f2b47744');

gr.query();

while (gr.next ()) {

arr. push(gr.u_cmdb_ci.sys_id. toString()); //u_cmdb_ci is custom field reference to cmdb_ci

}

return arr. join();

}
});

 

1 ACCEPTED SOLUTION

palanikumar
Mega Sage

How are you calling this new condition. Try this

Javascript:new UserUtileCustom().getUserGroups(current.variables.requested_for) + "^sys_idNOT IN" + new UserUtileCustom().getTidaljob().

Thank you,
Palani

View solution in original post

2 REPLIES 2

palanikumar
Mega Sage

How are you calling this new condition. Try this

Javascript:new UserUtileCustom().getUserGroups(current.variables.requested_for) + "^sys_idNOT IN" + new UserUtileCustom().getTidaljob().

Thank you,
Palani

Its working now. I had to change the query condition in script include and used you suggested code

Thanks @palanikumar