It's all about the answers!

Ask a question

How to get list of users? using Java plain API

Robert Siara (821014) | asked Dec 18 '12, 12:05 p.m.

How can I get a list of users using the Java API?

I will be grateful for any help you can provide.

Accepted answer

permanent link
Susan Hanson (1.6k2201194) | answered Dec 18 '12, 5:58 p.m.
            IContributorManager icm = teamRepository.contributorManager();
            List<IContributor> allContribs = icm.fetchAllContributors(monitor);
            System.out.println("I have " + allContribs.size() + " total users in the repository");

Returns all, including archived.  You can iterate on the allContribs list and check each IContributor to see if they are archived:
contributor.isArchived()  (where contributor came from the loop for (IContributor contributor : allContribs)).
Robert Siara selected this answer as the correct answer

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.