Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Show only Configuration Item whose class is marked as Principal CI

sntech
Tera Contributor

Hi Team,

 

The requirement is to show only Configuration Item on task table whose class is marked as Principal CI.

 

I used advanced reference qualifier and its script as below.

 

(function() {
var classList = [];
var gr = new GlideRecord('cmdb_class_info');
gr.addQuery('principal_class', true);
gr.query();
while (gr.next()) {
classList.push(gr.name.toString());
}
return 'sys_class_nameIN' + classList.join(',');
})();

 

 

 

This script worked in PDI, but not working in actual environment.

 

Is there any other possible way?

 

 

 

Thanks

2 REPLIES 2

Swapna Abburi
Giga Sage

Hi @sntech 

we already have an OOTB script include and function to filter CIs by principal CI classes. You can use it instead of writing a custom script.

 

javascript:new TaskUtils().getConfigurationItemFilter(current);

Ankur Bawiskar
Tera Patron

@sntech 

share dictionary screenshot of the field where you applied this

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader