Skip to content

Commit 1277fc1

Browse files
authored
script.js
1 parent d3cde61 commit 1277fc1

File tree

1 file changed

+19
-0
lines changed
  • Specialized Areas/CMDB/Class-Based Attribute Completeness Report

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var classes = ['cmdb_ci_win_server', 'cmdb_ci_appl', 'cmdb_ci_computer'];
2+
var fields = ['os', 'location'];
3+
4+
classes.forEach(function(className) {
5+
var total = new GlideAggregate(className);
6+
total.addAggregate('COUNT');
7+
total.query();
8+
var totalCount = total.next() ? total.getAggregate('COUNT') : 0;
9+
10+
fields.forEach(function(field) {
11+
var missing = new GlideAggregate(className);
12+
missing.addNullQuery(field);
13+
missing.addAggregate('COUNT');
14+
missing.query();
15+
var missingCount = missing.next() ? missing.getAggregate('COUNT') : 0;
16+
17+
gs.print(className + ' | Missing ' + field + ': ' + missingCount + ' / ' + totalCount);
18+
});
19+
});

0 commit comments

Comments
 (0)