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

How to get/set the workspace in Build Definition via SDK API

Hi,

Is there any one know how to get/set the workspace if I get the builddefiniton.

Thanks!

ITeamBuildClient buildClient = (ITeamBuildClient) repo.getClientLibrary(ITeamBuildClient.class);


IBuildDefinition buildDef = buildClient.getBuildDefinition(buildDefininionName, monitor);

//modify the name
buildDef = (IBuildDefinition)buildDef.getWorkingCopy();
buildDef.setId("aa");


This is the code to rename a definition id, how to reset a workspace?

Thanks!

0 votes


Accepted answer

Permanent link
Assuming the build definition was created with the Jazz SCM pre-build option, you can set the workspace property using:
com.ibm.team.build.common.model.IBuildDefinition.setProperty(String, String)
giving:
com.ibm.team.build.internal.common.builddefinition.IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID
as the property name, and the workspace item id as the value:
aWorkpace.getItemId().getUuidValue()


Jia Jia Li selected this answer as the correct answer

2 votes

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

Question asked: May 31 '12, 10:51 a.m.

Question was seen: 4,463 times

Last updated: Jun 13 '12, 2:58 p.m.

Confirmation Cancel Confirm