It's all about the answers!

Ask a question

Getting total number of change sets for a project area


Michael Payne (56175) | asked Sep 22 '10, 5:45 p.m.
I need a way to to collect the number of Workitems and change sets a project has in java. I am using the following to get the total number of workitems which works fine:
"/oslc/contexts/projectUuid/workitems.xml?oslc_cm.properties="

I'm struggling a bit to figure out how to get the number of change sets. Is there a query or API I can use to get the # of change sets?

6 answers



permanent link
Michael Payne (56175) | answered Sep 27 '10, 11:39 a.m.
I need a way to to collect the number of Workitems and change sets a project has in java. I am using the following to get the total number of workitems which works fine:
"/oslc/contexts/projectUuid/workitems.xml?oslc_cm.properties="

I'm struggling a bit to figure out how to get the number of change sets. Is there a query or API I can use to get the # of change sets?


I'm still struggling with this. I've written the following and I get an ArrayStoreException when trying to get the change set history.

IWorkspaceSearchCriteria wsSearchCriteria = WorkspaceSearchCriteria.FACTORY.newInstance();

wsSearchCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);
wsSearchCriteria.setPartialOwnerNameIgnoreCase(projectArea.getName());
List <IWorkspaceHandle> workspaceHandles = wm.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE, new SysoutProgressMonitor());

for (IWorkspaceHandle aWorkspaceHandle: workspaceHandles) {
IWorkspaceConnection workspaceConnection = wm.getWorkspaceConnection(aWorkspaceHandle, new SysoutProgressMonitor());
List<IWorkspaceHandle> thisWorkspaceStream = new LinkedList();
thisWorkspaceStream.add(aWorkspaceHandle);
List changeSets = workspaceConnection.changeSetsInHistory(thisWorkspaceStream, new SysoutProgressMonitor());
totalNumberOfChangeSets += changeSets.size();
}


Any help would be greatly appreciated. I've only been able to see the apis with no documentation along with it and searching the forums for any clues to how to write to the RTC api.

permanent link
Michael Payne (56175) | answered Oct 12 '10, 4:10 p.m.
I went a different route and used the webservice to get the number of changesets.

Once I get the workspace stream, I use this url to get the components:

https://server/jazz/resource/virtualPath/com.ibm.team.scm.rest.dto.WorkspaceDTO/workspace-stream_id

That returns a json which you can parse to get the component ids in the stream. I then use the following url to get the changesets:

https://server/jazz/service/com.ibm.team.scm.common.internal.rest.IScmRestService2/historyPlus?workspaceItemId=workspace-stream_id&componentItemId=component_id

permanent link
Kirk Broadwater (1611) | answered Oct 21 '10, 9:28 a.m.
I want to get a all the baselines for a specifc project in the stream. I can connect to the strea, but I can't get the baseline for that project.

permanent link
Geoffrey Clemm (30.1k33035) | answered Oct 22 '10, 7:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The scope of a baseline is a component, not a "project".
What did you have in mind for a "project"? An RTC project area? An
Eclipse project? Something else?

Cheers,
Geoff

On 10/21/2010 9:38 AM, kabeval wrote:
I want to get a all the baselines for a specifc project in the stream.
I can connect to the strea, but I can't get the baseline for that
project.

permanent link
Kirk Broadwater (1611) | answered Oct 26 '10, 8:06 a.m.
I want to get the files that are in the stream for a particular beaseline for a particule project area. I can get to the a particular beaseline from my local repository, but not from the stream.




The scope of a baseline is a component, not a "project".
What did you have in mind for a "project"? An RTC project area? An
Eclipse project? Something else?

Cheers,
Geoff

On 10/21/2010 9:38 AM, kabeval wrote:
I want to get a all the baselines for a specifc project in the stream.
I can connect to the strea, but I can't get the baseline for that
project.

permanent link
Michael Payne (56175) | answered Feb 10 '11, 4:48 p.m.
We are adding support for Rational Team Concert 3. The WebService method to get the number of Changesets doesn't work. I get a 400 error code. So far haven't been able to figure out what parameters have changed.

This brought me to revisit using the IWorkspaceConnection.changeSetsInHistory(List, IProgressMonitor) to get the changesets.

I get an ArrayStore exception because I don't know what the list this method requires should contain.

java.lang.ArrayStoreException
at java.util.ArrayList.toArray(ArrayList.java:330)
at java.util.Collections$UnmodifiableCollection.toArray(Collections.java:1017)
at com.ibm.team.scm.client.internal.FlowNodeConnection.changeSetsInHistory(FlowNodeConnection.java:492)
at com.ibm.team.scm.client.internal.FlowNodeConnection.changeSetsInHistory(FlowNodeConnection.java:476)


Can anybody tell me what the list should contain for the changeSetsInHistory method? I've tried IWorkspaceHandle, IWorkspace, and the list returned from IWorkspaceConnection.getComponents.

Or if anybody as an idea on what has changed for the Webservice for RTC3, that would be helpful too.

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.