- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 11:28 PM
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();
}
});
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 11:56 PM
How are you calling this new condition. Try this
Javascript:new UserUtileCustom().getUserGroups(current.variables.requested_for) + "^sys_idNOT IN" + new UserUtileCustom().getTidaljob().
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 11:56 PM
How are you calling this new condition. Try this
Javascript:new UserUtileCustom().getUserGroups(current.variables.requested_for) + "^sys_idNOT IN" + new UserUtileCustom().getTidaljob().
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2024 12:30 AM - edited ‎10-08-2024 12:46 AM
Its working now. I had to change the query condition in script include and used you suggested code
Thanks @palanikumar