It's all about the answers!

Ask a question

Listing snapshots of a Project Area and Team Areas

diogo cruz (21512) | asked Nov 17 '15, 10:15 a.m.
edited Nov 17 '15, 10:51 a.m.
 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) {
    return finalBaselineList;
  public List<IBaselineSetHandle> getSnapshotsFromProcessArea(
      final IProcessAreaHandle processAreaHandle) throws Exception {

    IBaselineSetSearchCriteria searchCriteria = IBaselineSetSearchCriteria.FACTORY.newInstance();
    return getWorkSpaceManager().findBaselineSets(searchCriteria, Integer.MAX_VALUE, monitor);

One answer

permanent link
Kohji Ohsawa (595138) | answered Nov 17 '15, 7:03 p.m.
Hi Diogo,

As far as I know, you need to repeat for each team area like you do. I used to do a same thing. I am guessing you are doing a right way.

Your answer

Register or to post your answer.