It's all about the answers!

Ask a question

Java API: Move Build Definitions to folder

Bradley Mosher (133) | asked Oct 13 '14, 2:14 p.m.

I am trying to move a Build Definition that was just created to a Build Definition folder in through the Java API. To do this I am using moveItemsToFolder. How do I genereate the IBuildFolderHandle? Below is my snippet of code and where I am stuck. Thank you!

IItemHandle defhandle = IComponent.ITEM_TYPE.createItemHandle("team.scm.workspaceUUID", "FAILED")), null);
IBuildFolderHandle buildfolder = newDefinition_workingcopy.getParent();
buildClient.moveItemsToFolder(defhandle, "IBuildFolderHandle", myMonitor);

One answer

permanent link
sam detweiler (12.5k6195201) | answered Oct 13 '14, 3:28 p.m.
edited Oct 13 '14, 3:30 p.m.
looks like you would have to search for the folder to get the handle..
here is how to do the query for buildengines.. (accepted answer)

IBuildFolder and IBuildFolderHandle are in the 5.0 javadoc.

Bradley Mosher commented Oct 13 '14, 3:48 p.m.

I see what you mean, I have never used the query funtionality. I will try that. Thanks! 

Bradley Mosher commented Oct 14 '14, 2:03 p.m.

Hi Sam, 

I am mostly there, however I cannot figure out what "iprja" in your example. 

Can you tell me what object that is? Thank you again for the help. I am a total newbie to this API starting last week.  

sam detweiler commented Oct 14 '14, 2:06 p.m. | edited Oct 14 '14, 2:07 p.m.

sorry shorthand for IProjectArea iprja;

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.