It's all about the answers!

Ask a question

Deleting users (non-LDAP Tomcat) in RTC 4.x?

Mike Shkolnik (9657160143) | asked Jan 06 '14, 5:14 p.m.
I see several folks have asked about this in the distant past, but it looks like it's been a year since it was last asked and I could swear the ability to delete users was added at some point.

We have a large number of users created back in RTC 2.x that had bad user IDs. These accounts were never actually used - have no work items or source artifacts associated with them - and thus there should not be any risk in removing them completely. I also wrote an app that uses the API to spit out a list of archived user accounts that don't own any work items or source artifacts, just to be sure.

We are using Tomcat with manually added IDs, not using LDAP. I know how to CHANGE user IDs, but we need to delete them as we long ago created good IDs to replace the bad ones.

sam detweiler commented Jan 06 '14, 9:29 p.m.

There is no Delete User function.

One answer

permanent link
Ralph Schoon (61.4k33643) | answered Jan 07 '14, 3:40 a.m.
Mike, I am not aware of a delete user function. In the web UI, you can archive users and get them out of the way.
I checked the repotools and there is also only the capability to archive the users exposed to users.
I can only imagine that the reason for this is that users could be potentially referenced at all kinds of places and deleting users could cause dangling references in many places.

There is an API call that allows to delete users, and it could be used, however, I am not sure if that could have bad consequences, should a user ID actually be referenced from other repository artifacts.

Mike Shkolnik commented Jan 07 '14, 12:25 p.m.

Can it be done with the REST API or does it require the Java API?

Mike Shkolnik commented Jan 07 '14, 1:30 p.m.

Since I am checking connections myself before deleting, I am not worried about breaking things. The report takes a long time to run since it checks ownership of 50,000 work items and all SCM and Build artifacts, but it does the job. These are "unused" user accounts.

Ralph Schoon commented Jan 08 '14, 3:01 a.m.

Mike, I have not tried REST. I found teamRepository.contributorManager().deleteContributor(contributorHandle, monitor) in the Plain Java Client Libraries. You could use this easily by modifying the code from The code is available for download from the post. You would just only have to change very few lines e.g. add a new method

    public static void deleteUserID(ITeamRepository teamRepository,
            String originalID, String newID, Boolean doUpdate, IProgressMonitor monitor)
            throws TeamRepositoryException {
        System.out.print("Delete user: " + originalID + (doUpdate ? "" : " - Simulation"));
        IContributor user = teamRepository.contributorManager()
                .fetchContributorByUserId(originalID, monitor);
        if (doUpdate) {
            teamRepository.contributorManager().deleteContributor(user, monitor);
        System.out.println(" - OK");

and replace the call to the other method by the call to the new method.

Mind the risk 8-)

Your answer

Register or to post your answer.