Calling script include in reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 06:36 AM
I have the below requirement:
I have form field - child server
In the child field should show all servers that has only 1 parent(or 1 row count),
I have below script in place, but this retrieves all child servers that has more than i parent
var serverrel = new GlideRecord('cmdb_rel_ci');
serverrel.addEncodedQuery('child.operational_status=1^child.ref_cmdb_ci_win_server.support_group=3217a87eeb054319562073cbb3546^child.sys_class_name=cmdb_ci_win_server^parent.name=' + current.variables.patch_application_service.getDisplayValue() + '^child.location.u_region=' + current.variables.patch_select_region);
serverrel.query();
var EquipementIDs = '';
while (serverrel.next()) {
EquipementIDs += ',' + serverrel.child;
}
return 'sys_idIN' + EquipementIDs;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 07:34 AM
So you are saying you want to fetch only those childs which are having more than 1 parent?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 08:17 AM - edited 08-09-2023 02:11 AM
@Ankur Bawiskar No, Which have only 1 parent.. this script is giving list of child server that has single and more parent