- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 12:14 AM
I'm trying to implement a GlideAjax scenario where, whenever a Server Class CI is selected in the Configuration Item field on the Incident form, the Description field should be auto-populated with details from the selected CI. The details include:
Asset Tag
Company
Operating System
OS Version
I have written the necessary client and server-side code using GlideAjax, and the functionality is working partially. The Asset Tag and Company are populating correctly, but the Operating System and OS Version are returning as undefined.
I'm attaching the screenshots of the code and form behavior for reference.
Could someone help me understand why OS and OS Version are not being retrieved, and how I can fix it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 11:51 PM
Hi @KarangulaB
OS and OS version belong to the 'cmdb_ci_server' table. You are querying the 'cmdb_ci' table, where those fields are not present.
So, modify your code to Glide through the cmdb_ci_server table. PFB the test run results from my pdi.
var ci = new GlideRecord('cmdb_ci');
ci.get('27e59e75c0a8000b003b3fab4211d2c2'); //CI sys id
gs.print("CMDB CI table OS: "+ci.getDisplayValue('os'));
gs.print("CMDB CI table OS Version: "+ci.getDisplayValue('os_version'));
gs.print("------------------------------------------");
gs.print(" ");
gs.print("------------------------------------------");
var ci1 = new GlideRecord('cmdb_ci_server');
ci1.get('27e59e75c0a8000b003b3fab4211d2c2'); //CI sys id
gs.print("CMDB CI SERVER table OS: "+ci1.getDisplayValue('os'));
gs.print("CMDB CI SERVER table OS Version: "+ci1.getDisplayValue('os_version'));
Output:
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 11:51 PM
Hi @KarangulaB
OS and OS version belong to the 'cmdb_ci_server' table. You are querying the 'cmdb_ci' table, where those fields are not present.
So, modify your code to Glide through the cmdb_ci_server table. PFB the test run results from my pdi.
var ci = new GlideRecord('cmdb_ci');
ci.get('27e59e75c0a8000b003b3fab4211d2c2'); //CI sys id
gs.print("CMDB CI table OS: "+ci.getDisplayValue('os'));
gs.print("CMDB CI table OS Version: "+ci.getDisplayValue('os_version'));
gs.print("------------------------------------------");
gs.print(" ");
gs.print("------------------------------------------");
var ci1 = new GlideRecord('cmdb_ci_server');
ci1.get('27e59e75c0a8000b003b3fab4211d2c2'); //CI sys id
gs.print("CMDB CI SERVER table OS: "+ci1.getDisplayValue('os'));
gs.print("CMDB CI SERVER table OS Version: "+ci1.getDisplayValue('os_version'));
Output:
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:22 PM
Thanks a lot! I updated by querying cmdb_ci_server, now I’m able to fetch the OS and OS Version fields correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 07:21 AM
@KarangulaB Glad it helped 👍