Copy/Move Build Definition to folder
![](http://jazz.net/_images/myphoto/81ac172e83f7ff97b16027543fa34bb5.jpg)
Hello,
I am attempting to copy a Build Definition outside of the root Build definition into a sub folder and I cannot find any hint of how to do this within the api documentation. I can successfully do anything I want to do within the root Build Definition folder. Can someone point me in the right direction as to where to find the documentation on how to do this?
Accepted answer
![](http://jazz.net/_images/myphoto/81ac172e83f7ff97b16027543fa34bb5.jpg)
Bradley,
please cp. my forum question with answer on how to search for IBuildFolder.
First, create your build definition. Then get a IBuildFolderHandle on the folder to which you want to move.
Put the BuildDefinition Handle in an array:
Apparently the call gets a working copy of the folder and saves it, too.
If this answers your question please mark it accepted.
- Arne
please cp. my forum question with answer on how to search for IBuildFolder.
First, create your build definition. Then get a IBuildFolderHandle on the folder to which you want to move.
Put the BuildDefinition Handle in an array:
IItemHandle[] itemHandles = new IItemHandle[] {myBuildDefHandle}; ClientFactory.getTeamBuildClient(repo).moveItemsToFolder(itemHandles, folderHandle, progressMonitor);
Apparently the call gets a working copy of the folder and saves it, too.
If this answers your question please mark it accepted.
- Arne
3 other answers
![](http://jazz.net/_images/myphoto/81ac172e83f7ff97b16027543fa34bb5.jpg)
I agree I cannot find anything relating to the Build Definition folder structure. I'm thinking it has to be some sort of property of the Build Definitions since I can copy Build Definitions that are in folders without actually specifying the folder. If anyone from jazz can tell me what property this might be it would be greatly appreciated.
Comments
![](http://jazz.net/_images/myphoto/24d940a6103a7586967eaa65499ead7a.jpg)
Currently trying to work this out as well. What I found is IBuildFolder and IBuildFolderEntry but I think it is not necessarily a property of build definition. Rather, an IBuildFolderEntry of an IBuildFolder can be either a handle on folder or a build definition.
Once a new IBuildFolderEntry is added, apparently one can save the folder with
ClientFactory.getTeamBuildClient(repo).save(buildFolder, progressMonitor);
I will post a reference to my post once a resolution is found.