- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 09:01 AM
I have created a table called Device Health Check (u_device_health_check) which extends from task. it stores health check tasks for devices in the CMDB.
I want to add this as a related list to ALL the CMDB class forms, so cmdb_ci_app_server, cmdb_ci_app_server_java, cmdb_ci_firewall_network etc etc
Is there a quick way of doing this using a background script?
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 09:50 AM
You have to add entries to sys_ui_related_list_entry table after getting list id's of the default views of tables that start with cmdb_ci. Get the list id and populate the sys_ui_related_list_entry
This script should help.
var rel = new GlideRecord('sys_ui_related_list');
rel.addQuery('calculated_name','ENDSWITH','Default view');
rel.addQuery('name','STARTSWITH','cmdb_ci');
rel.query();
while(rel.next()) {
var entry = new GlideRecord('sys_ui_related_list_entry');
entry.initialize();
entry.list_id = rel.sys_id;
entry.filter = // add the new table and column here. check existing ones for reference
entry.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 09:50 AM
You have to add entries to sys_ui_related_list_entry table after getting list id's of the default views of tables that start with cmdb_ci. Get the list id and populate the sys_ui_related_list_entry
This script should help.
var rel = new GlideRecord('sys_ui_related_list');
rel.addQuery('calculated_name','ENDSWITH','Default view');
rel.addQuery('name','STARTSWITH','cmdb_ci');
rel.query();
while(rel.next()) {
var entry = new GlideRecord('sys_ui_related_list_entry');
entry.initialize();
entry.list_id = rel.sys_id;
entry.filter = // add the new table and column here. check existing ones for reference
entry.insert();
}