Want to get CMDB CI field which shows up under the device tab under discovery schedule on the INC form

Utkarsha Saxena
Giga Contributor

Hi Guys,

Please guide me how to get the CMDB CI field which shows up on the Device page when a discovery is ran on the Incident form. Which table does that device field under discovery schedule come and how to get it on the incident form.. Please guide me through the whole process.. Thanks..

find_real_file.png

find_real_file.png

9 REPLIES 9

Hi Ashutosh,



I use client script. What is a Multi-sensor script ?


If I write a normal client script on Incident table, will this script work to have this field on the Incident table ?


Hi Utkarsha,



Yes in client script you have to Query below table:


discovery_device_history



From here you can fetch the CI information by using field cmdb_ci.



THanks


Hi Ashutosh,



I made the client script on the discovery_device_history table of onLoad type with the following script as cmdb_ci is the name for the field which I want on the incident table. Please also tell if I need to query the Incident table or build anything on that table.



function onLoad(result, ciData, debug, sensor)


{


var output = result.output;


gs.log('Output '+output,'Snow Sensor');


if (output === null || gs.nil(output))


return;


run(output, ciData, debug);


function run(output, ciData, debug)


{


var cmdb_ci = ciData.getData();


gs.log('Data Output '+ci_data.name,'Snow Sensor');


}


}



Is it correct ?



Thanks,


Utkarsha


Also we cannot use gs.log in client scripts. Please advice.



find_real_file.png