Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

I need to vet this and see whether it is true. I spot checked for Deb Bettley and Nancy Scanlon. Both were not members of the Alan version, but are members of the overall group. As such, this seems to really work.

Code Block
function findFinancialMembers() {
   var user_array = [];
   var user_in_group = new GlideRecord('sys_user_grmember');
   user_in_group.addQuery('group', '4da8813ea1a8990494ad46651315d87d'); //Financial Approvers group
   user_in_group.query();
   while (user_in_group.next()) {
      var group_count = new GlideAggregate('sys_user_grmember');
      group_count.addQuery('user', user_in_group.user.sys_id);
      group_count.addAggregate('COUNT');
      group_count.query();
      var groups = 0;
      if (group_count.next()) {
         groups = group_count.getAggregate('COUNT');
         if (groups == 1) {
            user_array.push(user_in_group.user.user_name);
         }
      }
   }
   return user_array;
}

 

Isolating ITIL users who didn't get the role from Financial Approvers

...