Populating variable with Child from cmdb_rel_ci table

Dawid2
Giga Guru

Hello, 

I'm facing following scenario. I have 2 variables: Service and Application. Service variable is a reference variable to one of the CMDB Classes. Application variable is a reference variable to cmdb_rel_ci table. I've set filtering for this variable to show only Applications with value from Service variable as parent. What I'm looking for is: if you select any entry in Application variable, it puts a CI Relationship record in there - I need actual Application record from it's application class. Can this be achieved?

2 REPLIES 2

Mark Manders
Mega Patron

No. 

Why are you surprised it shows a CI Relationship record there. That's exactly what you are telling the system to do. The display value of the cmdb_rel_ci table is the relationship, not the child field and you should also never change that, because it will have huge impact on your system.

Why are you getting the application from the cmdb_rel_ci table? It's an application, put the reference towards the cmdb_ci_appl table (since that's what you are trying to do already) and filter from there to the cmdb_rel_ci table to only show those that are a child to a service in the cmdb_rel_ci table.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Thank you for answering and I'm no surprised, I know it's doing what it's supposed to do. I tried switching table to cmdb_ci_appl table and filter it, but I coulnd't get it to work. Maybe my script is faulty?

 

javascript:
(function(current){
var beatSysId = 'sys_idIN'
var beat = new GlideRecord('cmdb_rel_ci');
beat.addEncodedQuery("parent=" + current.variables.u_service);
beat.query();
while(beat.next()){
beatSysId += beat.sys_id + ','
}
return beatSysId;

})(current);