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 |
Accepted answer
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 ?
Yes, that is correct.
|
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.
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.