It's all about the answers!

Ask a question

How to archive a user via the API


Andrew Freed (21311214) | asked Oct 27 '10, 8:22 a.m.
JAZZ DEVELOPER
I have found a public API for deleting a user but I have found out that is a really bad idea. How in the API can I archive a user?

3 answers



permanent link
Stephanie Bagot (2.1k1513) | answered Nov 03 '10, 1:37 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
I would recommend doing this through the Web UI by clicking on User Management, and highlighting over the user name. This will create a button to archive the user. You can also run repotools to archive a user:
#repotools.bat -archiveUser

permanent link
Andrew Freed (21311214) | answered Nov 09 '10, 8:52 a.m.
JAZZ DEVELOPER
I need an API for doing this. I want to be able to archive periodically several users from several servers and going to the UI will get cumbersome.

permanent link
Andrew Freed (21311214) | answered Nov 18 '10, 9:11 a.m.
JAZZ DEVELOPER
For anyone interested, the code for archive user looks like this


IProgressMonitor monitor = new NullProgressMonitor();
IContributorManager cmgr = repo.contributorManager();
try {
IContributor contributor = cmgr.fetchContributorByUserId(userId, monitor);
contributor = (IContributor) contributor.getWorkingCopy();
contributor.setArchived(true);
cmgr.saveContributor(contributor, monitor);
} (catch ....)

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.