Referance Qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 08:50 AM
Based on selected server i need populate Ip_address in CIIP Field
For this CIIP field I selected cmdb_ci_ip_address table
in this table cmdb_ci is a server name field so that so i write
Referance Qualifier :javascript:'cmdb_ci'=current.variables.server
Catalog item
please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:24 AM
Hey @Prem96
Try with this script:
// Get the selected server from the current record
var selectedServer = current.variables.server;
// Create a GlideRecord query to filter IP addresses based on the selected server
var gr = new GlideRecord('cmdb_ci_ip_address');
gr.addQuery('cmdb_ci', selectedServer); // cmdb_ci is the server name field
gr.query();
// Build a query string for the reference qualifier
var query = 'sys_idIN';
var first = true;
// Append each sys_id to the query string
while (gr.next()) {
if (!first) {
query += ',';
}
query += gr.sys_id;
first = false;
}
// Return the query string
answer = query;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:41 AM
Hi Thanks for Your response. But Its Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:36 AM
The cmdb_ci_ip_address does not contain a field named cmdb_ci, so you have to get there from the NIC. You should be able to dot-walk in a reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 10:12 AM
For that i write a script include and Reference Qualifier
Can you please help me.