How can I get result for a specific build request using REST api?
Accepted answer
https://jazzdev.torolab.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildRequest/_MXgfIMdvEeO185rLDU7C-w?_mediaType=text/json&_prettyPrint=true
"buildResult": {
"com.ibm.team.repository.typeName": "com.ibm.team.build.BuildResult",
"itemId": "_MXhtQcdvEeO185rLDU7C-w",
"uri": "itemOid\/com.ibm.team.build.BuildResult\/_MXhtQcdvEeO185rLDU7C-w"
},
Comments
Note that the _mediaType and _prettyPrint query args are just for debugging. In a programmatic request you would specify an Accept header with text/json.
Thanks Nick for your answer. Once I've the buildResult itemId how can I get the complete element (for example to get buildResult status SUCCESSFUL/FAILED)? Can I use this uri I have in return from buildRequest call?
You can either request .../resource/virtual/build/result/[result itemID UUID] or .../resource/itemOid/com.ibm.team.build.BuildResult/[result itemID UUID]. The latter normally redirects to the web UI when pasted into a browser, but if requesting with Accept header of text/xml or text/json, it'll give you the item. There's also .../resource/virtual/build/resultrecord/[result itemID UUID] which gives more info including the request item.
Thanks Nick. I will use this way.