how to get all the streams under one projectArea?
Jayashri shrinivas (13●1●12)
| asked Aug 19 '19, 6:51 a.m.
edited Aug 19 '19, 7:48 a.m. by Ralph Schoon (63.5k●3●36●46)
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
Ralph Schoon (63.5k●3●36●46)
| 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
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);
Thanks David! |
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.