Include CI's for child classes on reference qualifier.

Shane Vidal-Hal
Kilo Contributor

Is it possible to create a configuration item reference qualifier to return all CI's from a parent class and include child class CI's as well. Currently you can specify individual classes but I would like to return all CI's below the server class for instance. I see there is a field called sys_class_path. Could this be used?

1 ACCEPTED SOLUTION

srphayre
Giga Contributor

Hi Shane,

 
There is a function called getTableExtensions which returns all of the extended tables from a base table.

 

More info here: https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_TU-getTableExtensions

 

Hope that helps!

 

Steve

ITSM Guy at Expedia Group

View solution in original post

7 REPLIES 7

palmen
Tera Guru

It's definitely doable with a reference qualifier.

What you need to do is write a script inlcude that returns all these CIs
new myScriptInclude().nameOfFunction()

The function in the script include is where you put the logic. You can pass values into this function

Make a gliderecord query to get all parent class CIs and also child class CIs and store them in a variable you return.

Shane Vidal-Hal
Kilo Contributor

Hi Palmen

Thanks for the reply. I am familiar with using script includes in reference qualifiers. This is not the core challenge. It is the filtering or search criteria I need to know to return child class CI's. So for example if i chose to use the example you gave, what would the script query look like?

Thanks

Shane

Kalaiarasan Pus
Giga Sage

Wouldn't the child class CI be already present on parent class? Querying parent directly does not return the child CIs?

Shane Vidal-Hal
Kilo Contributor

Hi

If using the class as search criteria in a simple query, it only brings back CI's in that class and not the Child CI's.

 

Shane