Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

API to get the details of a person who commit code to RTC

Hello,

How can i get the details like name/usrid, email address of a person who committed code to RTC.
is there any command to get these details..? or any API's?

Thanks & Regards
Shruti

0 votes



One answer

Permanent link
Hi,

The following method "may" work., I haven't tested personally.
Please do let me know if this works..



public void printModifiedByInRepositoryWorkspace(
            ITeamRepository repository, IProgressMonitor monitor)
            throws TeamRepositoryException, ItemNotFoundException {

        IWorkspaceManager iWorkspaceManager = SCMPlatform
                .getWorkspaceManager(repository);

        int maxSize = 4;
        monitor.subTask("Printing MODIFIED BY IN workspace");
        IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY
                .newInstance();

        criteria.setExactName("rtcWorkspace");
        criteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
        java.util.List<IWorkspaceHandle> workspaceList = iWorkspaceManager
                .findWorkspaces(criteria, maxSize, monitor);
        System.out.println("found " + workspaceList.size()
                + " matching workspaces");

        for (IWorkspaceHandle iWorkspaceHandle : workspaceList) {
            IWorkspace iWorkspace = (IWorkspace) repository.itemManager()
                    .fetchCompleteItem(iWorkspaceHandle, IItemManager.DEFAULT,
                            monitor);
            IContributorHandle iContributorHandle = iWorkspace.getModifiedBy();
            IContributor iContributor = (IContributor) repository.itemManager()
                    .fetchCompleteItem(iContributorHandle,
                            IItemManager.DEFAULT, monitor);
            System.out.println(iContributor.getName() + "\t"
                    + iContributor.getUserId() + "\t"
                    + iContributor.getEmailAddress());
        }
    }

0 votes

Comments

Hello Ajay,

 java.util.List<iworkspacehandle> workspaceList = iWorkspaceManager.findWorkspaces(criteria, maxSize, monitor);

can i know what is maxSize and iworkspacehandle?

Hi..,

I'm sorry.
I've modified the method..,
You can now have a look at it.

Hello Ajay,

What is ITeamRepository repository and IProgressMonitor monitor ?

Thanks & Regards
Shruti

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020

Question asked: Jun 05 '14, 1:17 a.m.

Question was seen: 3,263 times

Last updated: Jun 05 '14, 4:50 a.m.

Confirmation Cancel Confirm