It's all about the answers!

Ask a question

Programatically fetch the streams belong to Project area using RTC JAVA API.


Rajat Krishnan (7015) | asked Jan 03 '20, 8:47 a.m.
edited Jan 04 '20, 4:19 a.m.
Hello Team,

Usecase:
Programatically fetch the streams belong to Project area in RTC JAVA API.

Our Structure:
Streams - owned by Team area.

We have below snippet,
RTCConnect rtcConnection = new RTCConnect(cli.getrepositoryURI(), cli.getUser(), cli.getPassword());
                teamRepository = rtcConnection.getTeamRepository();
                IWorkspaceManager workspaceMgr = SCMPlatform.getWorkspaceManager(teamRepository);
                IWorkspaceSearchCriteria wsSearchCriteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
                wsSearchCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);
                //wsSearchCriteria.setPartialOwnerNameIgnoreCase(cli.getprojectArea());
                List<IWorkspaceHandle> workspaceHandles = workspaceMgr.findWorkspaces(wsSearchCriteria,
                        Integer.MAX_VALUE, null);

Do we have any option in IworkspaceSearchCriteria to get the desired output?
or help me way to get the output.

Thanks in Advance!!

One answer



permanent link
Shashikant Padur (4.2k27) | answered Jan 05 '20, 10:26 p.m.
JAZZ DEVELOPER
With the above search what was the output?
If you have the project area handle you can pass that to the search criteria instead of the name pattern.
wsSearchCriteria.getFilterByOwnerOptional().add(IProjectArea)

Comments
Rajat Krishnan commented Jan 06 '20, 4:19 a.m.
- We are getting list of streams of total repository.

wsSearchCriteria.getFilterByOwnerOptional().add(IProjectArea)->
As mentioned we have few streams set to Team area and few to Project area scope
for eg: Stream A -> owned by ALM Team of ALMProjectArea
Steam B ->Owned by ALMProjectArea

i would like to get streams above mentioned streams,
Stream A and Stream B.

Will searchcriteria support?

Shashikant Padur commented Jan 06 '20, 4:35 a.m.
JAZZ DEVELOPER

yes, you can add multiple project areas and team areas because getFilterByOwnerOptional() returns a List<IAuditableHandle>:

wsSearchCriteria.getFilterByOwnerOptional().add(IProjectArea) // projarea1
wsSearchCriteria.getFilterByOwnerOptional().add(IProjectArea) // projarea2
wsSearchCriteria.getFilterByOwnerOptional().add(ITeamArea) // teamarea1
wsSearchCriteria.getFilterByOwnerOptional().add(ITeamArea) // teamarea2

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.