Name

global.PAUsageUtil

Description

No description available

Script

var PAUsageUtil = Class.create();
PAUsageUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  getSysIDs: function() {
      var gra = new GlideAggregate('sys_portal_page');
      gra.groupBy('user');
      gra.query();
      var userIDs = [];
      while (gra.next()) {
          userIDs.push(gra.user.toString());
      }
      return userIDs;
  },

  getUserIDs: function(count) {
      var gra = new GlideAggregate('sys_report');
      gra.groupBy('sys_updated_by');
      if (count) {
          gra.addHaving('COUNT', '>', count);
      }
      gra.query();
      var userNames = [];
      if (gra.canRead()) {
          while (gra.next()) {
              userNames.push(gra.sys_updated_by.toString());
          }
      }
      return userNames;
  },

  getReportTables: function() {
      var gra = new GlideAggregate('sys_report');
      gra.groupBy('table');
      gra.addHaving('COUNT', '>', 5);
      gra.query();
      var reportTables = [];
      if (gra.canRead()) {
          while (gra.next()) {
              reportTables.push(gra.table.toString());
          }
      }
      return reportTables;
  },

  type: 'PAUsageUtil'
});

Sys ID

4ef4d3e0b37003003e5362ff86a8dc2a

Offical Documentation

Official Docs: