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

Query workspace using uuid

Hi,
   Please help me to query workspace using UUID.
  
   My requirement is to find workspace associated to a build definition, but I can only find UUID of the workspace.
To get the real workspace I need to query workspace using UUID.

Can any body help in finding workspace using UUID.

Any help will be appreciated.

----
Thank you
Sarath.s.kumar

0 votes

Comments

Can you clarify what you're trying to do? Is this using one of the clients to find a workspace or are you using the plain Java client libraries?

I am using RTC sdk java client. I want to know how to get current workspace  for a build definition using sdk. I am getting an itemId but not the workspaceHandle.

is there any way to access workspace handle from a build definition directly ?
or
if I am having UUID how I can query a workspace using this itemID.


Accepted answer

Permanent link
IWorkspaceHandle wsHandle = (IWorkspaceHandle) IWorkspace.ITEM_TYPE.createItemHandle(itemId, null);
IWorkspace ws = repo.itemManager().fetchCompleteItem(wsHandle, IItemManager.DEFAULT, null);

repo (ITeamRepository) is your repository connection.
Sarath Shasikumar selected this answer as the correct answer

1 vote

Comments

Thank you, this code actually helped me to get workspace using UUID.


What I understood is, if we have itemID we can create handles directly for any type right ?
 

Yes, that is correct.

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,938

Question asked: Jul 25 '13, 3:18 a.m.

Question was seen: 4,512 times

Last updated: Jul 26 '13, 3:28 a.m.

Confirmation Cancel Confirm