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

Request a build via REST api

I would like to be able to request a build execution via REST api.
I'd like also to programmatically, still via REST api, set the build definition properties, before requesting the build.
Is this possible in RTC version 4.x?
Can anybody provide some sample pieces of code?
Thanks in advance.

0 votes


Accepted answer

Permanent link
Luca, can you provide more details about your use case?  Does it have to be via REST or could you use the Java client API too?  The REST interface that supports the Build web UI does support issuing build requests, including overriding / removing build properties (but not configuration element properties).  Changing the build definition is also possible, but I'm guessing you only want to do that per-request.

Try looking at the HTTP request issued when you request a build via the web UI, using Firebug or whatever your favourite web debug tool is. e.g. if I request a build for definition with id "somedefinition", and adding one property and removing another, it should do a POST with:
url: <repo>/resource/virtual/build/requests
headers: Accept: text/json, Content-Type: text/json;charset=UTF-8
body: {"definition":"somedefinition","allowDuplicateRequests":true,"newOrModifiedProperties":[{"kind":"com.ibm.team.build.property.string","name":"addedProperty","value":"some value","description":"","isRequired":false,"isGenericEditAllowed":true}],"deletedProperties":[{"name":"deletedPropertyName"}]}

Luca Martinucci selected this answer as the correct answer

3 votes

Comments

Note that the Build REST interface is internal, though, not API, so it may change at any time.  That said, it has been pretty stable between releases, and we try not to make gratuitous changes. 


2 other answers

Permanent link
Hi Luca,

This is discussed in another thread ... https://jazz.net/forum/questions/26893/build-rest-api?redirect=%2Fforum%2Fquestions%2F26893%2Fbuild-rest-api.

The story Nick references is resolved now, but it's unclear to me if an API was ever documented.  I'll get Nick to chime in here.

Scott

1 vote


Permanent link
You can also use this one: https://jazz.net/forum/questions/135858/how-to-perform-particular-action-using-rest-api-in-clm-applications

0 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
× 562
× 516
× 479
× 137
× 62

Question asked: Mar 28 '13, 5:45 a.m.

Question was seen: 24,148 times

Last updated: Jan 21 '14, 11:10 a.m.

Confirmation Cancel Confirm