It's all about the answers!

Ask a question

Query workspace using uuid


Sarath Shasikumar (1759) | asked Jul 25 '13, 3:18 a.m.
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

Comments
Tim Mok commented Jul 25 '13, 10:06 a.m.
JAZZ DEVELOPER

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?


Sarath Shasikumar commented Jul 25 '13, 11:37 a.m.

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
Shashikant Padur (4.3k27) | answered Jul 26 '13, 1:49 a.m.
JAZZ DEVELOPER
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

Comments
Sarath Shasikumar commented Jul 26 '13, 2:30 a.m.

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 ?
 


Shashikant Padur commented Jul 26 '13, 3:28 a.m.
JAZZ DEVELOPER

Yes, that is correct.

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.