It's all about the answers!

Ask a question

how to get all the streams under one projectArea?


Jayashri shrinivas (13112) | asked Aug 19 '19, 6:51 a.m.
edited Aug 19 '19, 7:48 a.m. by Ralph Schoon (63.3k33646)
How to get list of streams/workspaces from a given project area.

I have a repository and a Project area. I want to get the list of streams from PA using java API.

Thanks in advance

Accepted answer


permanent link
Ralph Schoon (63.3k33646) | answered Aug 19 '19, 7:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Workspaces are owned by users. Streams are owned by project areas or team areas.


Searching for a bunch of the SCM items is done using search criteria.

https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ shows examples for this API. You would likely have to use com.ibm.team.scm.common.dto.IWorkspaceSearchCriteria.setExactOwnerName(String). 

David Lafreniere selected this answer as the correct answer

Comments
David Lafreniere commented Aug 19 '19, 2:53 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Note: IWorkspaceSearchCriteria.setExactOwnerName(String) would work, but if you wrote your code with a hardcoded stream name, then there is a risk that the stream is renamed at a future date resulting in nothing being returned by the query.

To avoid this, you could call: IWorksapceSearchCriteria.getFilterByOwnerOptional().add(streamHandle);


Ralph Schoon commented Aug 20 '19, 1:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Thanks David! 

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.