how to group by class name change class name in cmdb_ci_network_circuit table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2024 03:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2024 03:10 AM
Don't understand your question. Please provide more details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2024 03:12 AM
Hi,
Can you elaborate what the issue is?
Generally speaking, You can just right click on the Class header column and group by it. How ever in your screenshot you have a filter that class = Logical Connection , so you will only see 1 group, if you want to see all groups then remove the filter and then apply grouping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2024 03:19 AM - edited 05-24-2024 03:25 AM
You can rename table name to cmdb_ci_network_circuit to Logical connect or vise versa.
or
var gr = new GlideRecord('cmdb_ci');
gr.addQuery( 'name' , 'AUBX04')
gr.query();
while(gr.next()) {gr.sys_class_name.setValue('table_dictionary_name); //For instance Logical COnnection.
gr.update();
gs.print(gr.getClassDisplayValue());
}
)
I sense you want to see distinct Value of column class
var ga = new GlideAggregate('cmdb_ci_network_circuit');
ga.addAggregate('count');
ga.addAggregate('count(distinct','class');
ga.setGroup(false);
ga.query();
while(ga.next())
{
gs.info(agg.getAggregate('count(distinct','class')));
}
Try to run in background Script