We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Report to find users with the same name but different sys_id or user_name

karolisjon
Tera Contributor

Hello, I need to build a report which would filter our users who have identical names, but different UserIDs. Using the GlideAggregate I was able to print them out through a background script (unless something is incorrect in my code): 

 

 

var duplicateUsers = new GlideAggregate('sys_user');
duplicateUsers.groupBy('name');
duplicateUsers.addHaving('COUNT', '>', 1);
duplicateUsers.query();

gs.info(duplicateUsers.getRowCount());

while (duplicateUsers.next()) {
    gs.info('Users with the same name: ' + duplicateUsers.name);
}

 

How can I achieve the same in a simple report? I dont have the option to group users where COUNT > 1. Any tips on how to achieve this? 

Thanks!

1 ACCEPTED SOLUTION
2 REPLIES 2

Thanks @Mike_R that seem to have solved my issue.