Listing snapshots of a Project Area and Team Areas
Hi Everyone,
Using the API, I want to list all snapshots from a Project Area and its children (Team Area Hierarchy).
Can I achieve this with a single search?`
The only solution I found til now is to search in every Team area of the hierarchy and append the results together.
This is my current code:
public List<IBaselineSetHandle> getSnapshotsFromProcessAreaAndChildren(final IProjectArea projectArea {
List<IBaselineSetHandle> finalBaselineList = new ArrayList<IBaselineSetHandle>();
List<ITeamAreaHandle> teamAreas = projectArea.getTeamAreaHierarchy().getTeamAreas();
for (ITeamAreaHandle iTeamAreaHandle : teamAreas) {
finalBaselineList.addAll(getSnapshotsFromProcessArea(iTeamAreaHandle));
}
finalBaselineList.addAll(getSnapshotsFromProcessArea(projectArea));
return finalBaselineList;
}
public List<IBaselineSetHandle> getSnapshotsFromProcessArea( final IProcessAreaHandle processAreaHandle) throws Exception { IBaselineSetSearchCriteria searchCriteria = IBaselineSetSearchCriteria.FACTORY.newInstance(); searchCriteria.setProcessArea(processAreaHandle); return getWorkSpaceManager().findBaselineSets(searchCriteria, Integer.MAX_VALUE, monitor); }