TableUtils not working in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2018 04:13 PM
I have included TableUtils in script include (not working)..however it worked when I ran in background script
var tu = new global.TableUtils(sysClass);
var classHierarchy = tu.getTables().toArray();
ciClassH=classHierarchy.join(':');
var ciParentTable=['cmdb_ci_hardware','cmdb_ci_appl','cmdb_ci','cmdb_ci_netgear','cmdb_ci_server'];
var hierarchyName=['Hardware Hierarchy','Application Instance Hierarchy','Independent Hierarchy','Network Hierarchy','Server Hierarchy'];
for(var x=0;x<classHierarchy.length;x++)
{
var arrayUtil = new ArrayUtil();
if(arrayUtil.indexOf(ciParentTable, classHierarchy[x])>-1)
{
TableHierarchy=
hierarchyName[arrayUtil.indexOf(ciParentTable,classHierarchy[x])];
break;
}
}
tableHierarchy=TableHierarchy;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2018 05:11 PM
What are you passing in sysClass?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2018 06:09 PM
class names..like cmdb_ci_appl

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2018 09:21 PM
Hm, I just pasted the script in earlier comment into my instance, substituted sysClass with 'cmdb_ci_appl' and added gs.print(tableHierarchy) to the end. It printed the expected 'Application Instance Hierarchy'. Are you sure your TableUtils script include hasn't been customized?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2018 06:44 PM
I'm writing this script for a scoped app...