Add custom CMDB related list

ramak
Giga Expert

Hey guys, I'm trying to add a new related list which shows the list of records from 'cmdb_rel_ci' table up-to a certain table only. This related list is

on the Change Request table. So when a CI(server/switch/router etc) gets selected, the new related list must display all the related CI's ground up.

Like this : Server 'related to' Database 'in turn related to' Application 'in turn related to' Bus Application service (this is a custom CI class). This issue here is the related list is not showing the

relationships 2 levels up, but only the first level. Any idea what can be done to show all the direct and in-direct relationships in the related list?

This is the screenshot:

find_real_file.png

12 REPLIES 12

Sharique Azim
Mega Sage

Hi Suhas,



Can we take up the old way and include .addOrCondition in the new line like current.addOr....?



One more thing   i noticed , if its already on the cmdb_rel_ci table why are you using Gliderecord or array.push?


Does it matter as both are same? And the script is only using the


current.addQuery line... the rest of the lines in the script are not


used...


Hi Suhas,



Please remove the Glide Record part,



And use the   line


current.addEncodedQuery('parent.sys_id='+ parent.cmdb_ci+'^ORchild.sys_id='+ parent.cmdb_ci);



removing all the other lines.. That should do


Hi Suhas,



Did you get a chance to try this maybe?