It's all about the answers!

Ask a question

How do I get the build work space

vaisakh devaraj (2156) | asked Jul 25 '13, 3:17 a.m.
Using SDK, I am trying to read the build work space corresponding to a build definition. 

From Build definition using the property "team.scm.workspaceUUID" I am able to get the work space UUID using the following code

   ITeamBuildClient buildClient = (ITeamBuildClient) this.teamRepository.getClientLibrary( ITeamBuildClient.class );
   IBuildDefinition buildDef = buildClient.getBuildDefinition( "ADM Metrics Build", this.progressMonitor );
  String workSpaceUUID = buildDef.getProperty( "team.scm.workspaceUUID" ).getValue();

Now I need to find the workspace object (IWorkspaceHandle).

Any idea how do I get the workspace handle from work space UUID.  

One answer

permanent link
Tim Mok (6.6k38) | answered Jul 25 '13, 10:48 a.m.
Handles can be created by calling the ITEM_TYPE on the type.

For IWorkspaceHandle, you call the IWorkspace.ITEM_TYPE to create the item handle:
IWorkspace.ITEM_TYPE.createItemHandle(itemId, optionalStateId)
Fill in the workspace UUID for the item ID and you can use null for the state ID.

Your answer

Register or to post your answer.