File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Specialized Areas/CMDB/Class-Based Attribute Completeness Report Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments