I'm trying to find a way to get all the comments from a particular build in TeamCity via the Rest API. How can one do that?
To view the history of builds in the current configuration, click previous and next links in the upper right corner of Build Results. Click All history link to open the History tab.
BuildLocator Last modified: 21 September 2022. Represents a locator string for filtering Build entities. Examples: id:1 — find build with ID 1 .
To run a custom build with specific changes, open the build results page, go to the Changes tab, expand the required change, click the Run build with this change, and proceed with the options in the Run Custom Build dialog. Use HTTP request or REST API request to TeamCity to trigger a build.
http://teamcity:port/httpAuth/app/rest/changes?locator=build:(id:77651)&fields=count,change:(version,username,date,href,comment,files)
Via this URL, one can list out in custom fashion exactly the fields they wish to return. I don't think this is documented, i got this from their support folks. Enjoy!
PS - There are other examples out there which iterate over each change, this lists out all the changes for a particular build id in one place, for parsing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With