Get Server Operating System
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 09:37 AM
Hi,
We are having a select box variable (server os) where there are Windows and Linux option. We also have another variable called Server which is a reference field from cmdb_ci_server table with conditions class is Windows and Linux.
Now once we select a server the server os should populate with Windows if the server Class is Windows else it should populate Linux. Please suggest on this.
Thanks
Phani
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 09:49 AM
You mention variables, is this a catalog request? What is the intention of this feature. Please let us know so we can solution accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 10:45 AM
Hi johnson,
yes it is a catalog.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 09:50 AM
Him,
If I understand correctly, when you select the server on reference field, based on that you need to populate the server os dropdown, if so then use this
This is an onchange client script that runs when the value is selected in the reference field.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ref = g_form.getReference('<reference field name>', getServerOS);
}
function getServerOS(ref) {
g_form.setValue('<dropdown field>', ref.<OS field on Server Table referenced>);
}
Just add the appropriate field names
-Anurag