Using REST API to trigger a clone of a build already done


I am trying to use the REST API to trigger a build which exactly mimics the changes and parameters that might have been triggered earlier using the WEB interface. e.g., If a build was triggered by a person couple of days ago with certain changes and parameters, and I have that build ID - I would like to retrigger a build with the same changes and parameters.
I looked at the REST API and am able to figure out how to send parameters to the build. I am pretty much confused with how to specify exactly the changes that should go into build(we are using SVN). I see that there are few fields returned for the build' - one is nodes tof lastChanges and then there is the changes node which is the href to another link, and then there is the revisions field. Now the lastChagnes always returns an id while the link referred to by changes node may be empty at times .

The questions are:

  • What is the difference beween lastChanges node and the results of the changes node and revisions node?
  • Which one should I pass to the REST API to trigger a clone of the build which was done and in which parameter of the API should I pass it?
  • Is there an wasy way to trigger a 'clone' of a build using REST API?


1 comment
Comment actions Permalink

For anyone who is interested: The solution is to get the build node of the spawned build, remove unnecessary elements and send that as the build node to be added to the queue.


Please sign in to leave a comment.