List All the application which are linked to any server

Community Alums
Not applicable

I want to list out all the APAC Life, Non Life application which are linked to any server.

1 ACCEPTED SOLUTION

CasperJT
Tera Guru

Hi Sonali,

 

I would suggest checking out the CMDB Query Builder. I think it will give you the result you are looking for.

 

You can set up a query like this, which will generate a list of applications and their underlying servers:

CasperJT_0-1686900046272.png

 

More information about the feature can be found here Build a CMDB query using the CMDB Query Builder

 

Hope this helps,

 

//Casper

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi Sonali,

 

You would be able to see that already in your Server record, if the relationships have been set up correctly. PFB an example in screesnhot.

Please mark this comment as Correct Answer/Helpful if it helped you.

 

Cheers,

Hardit Singh

 

HarditSingh1_0-1686891460015.png

 

 

Community Alums
Not applicable

Hi,
I want the record in list view

Like column application name, server name 

jaheerhattiwale
Mega Sage
Mega Sage

@Community Alums you can query the ci relationships table and the list like below.

 

var apps = [];

var ciRelGr = new GlideRecord("cmdb_rel_ci");

ciRelGr.addQuery("parent.sys_class_name=<SERVER TABLE NAME HERE>");

ciRelGr.addQuery("child.sys_class_name=<APPLICATION TABLE NAME HERE>");

ciRelGr.query();

 

while(ciRelGr.next()){

apps.push(ciRelGr.child.toString());

}

 

var ciRelGr = new GlideRecord("cmdb_rel_ci");

ciRelGr.addQuery("child.sys_class_name=<SERVER TABLE NAME HERE>");

ciRelGr.addQuery("parent.sys_class_name=<APPLICATION TABLE NAME HERE>");

ciRelGr.query();

 

while(ciRelGr.next()){

apps.push(ciRelGr.parent.toString());

}

 

Please mark as correct answer if this solves your issue.

 

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

CasperJT
Tera Guru

Hi Sonali,

 

I would suggest checking out the CMDB Query Builder. I think it will give you the result you are looking for.

 

You can set up a query like this, which will generate a list of applications and their underlying servers:

CasperJT_0-1686900046272.png

 

More information about the feature can be found here Build a CMDB query using the CMDB Query Builder

 

Hope this helps,

 

//Casper