Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC 6.0: how to get workSpace owned/created by user in Plan Java API

 Hi All ,

I am able to get list of all the work spaces but i need filter out for all the work spaces owned/created by perticular/current user. Any help would greatly appreciated. 

0 votes


Accepted answer

Permanent link
  Hey I got the answer. Here is the code for getting workspaces for exact owner.It might help someone :)
                     //Set the criteria for workspace
IWorkspaceSearchCriteria workspaceCriteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
workspaceCriteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
//getting workspaces of exact owner.
workspaceCriteria.setExactOwnerName(repository.loggedInContributor().getName());
List<IWorkspaceHandle> workspaceList;
workspaceList = mgr.findWorkspaces(workspaceCriteria, Integer.MAX_VALUE, null);
Stream workspaceObj = null;
@SuppressWarnings("unchecked")
           List<IWorkspace> iWorkspaces = repository.itemManager().fetchCompleteItems(workspaceList,       IItemManager.DEFAULT, null);
Ralph Schoon selected this answer as the correct answer

0 votes


One other answer

Permanent link

 I would suggest to look into https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ and to enhance the seach criteria for the owner.

0 votes

Comments

 Thanks Ralph for your quick response.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,946

Question asked: Feb 01 '17, 6:55 a.m.

Question was seen: 2,580 times

Last updated: Feb 24 '17, 6:22 a.m.

Confirmation Cancel Confirm