...
Here's the listing I've been working with: https://yaledevelopmentyale.service-now.com/sys_user_has_role_list.do
I've been working with Alan at Fruition to build up a list of Financial Approver group members who are not also members of any other assignment group. He came up with:
https://yaledevelopmentyale.service-now.com/financial_approvers_singleton_members.do
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; } |
...
I compared my long ITIL method against the Alan method and still came up with 1183; so I'm baffled. Anyway, this is a sufficient answer. Going to wrap it, and hand it over.
The method to get the real answer people wanted from me is:
https://yale.service-now.com/itil_without_finance_approver_singletons.do