4

I am trying to trigger a custom build on a project passing in a specific modificationId as mentioned here.

e.g httpAuth/action.html?add2Queue=bt27&modificationId=3605

This works great. However I need to be able to get the modificationId of the last know successful build. I cannot see or find any mention of this in the rest api docs.

I am able to retrieve the buildId of the last successful build but the modificationId is not included

e.g httpAuth/app/rest/buildTypes/id:bt27/builds/status:SUCCESS/number

Does anybody know how to get a list of modificationIds from the rest api?

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
redsquare
  • 78,161
  • 20
  • 151
  • 159
  • Do you happen to know whether it's possible to trigger a custom build and pass in custom parameters to said build, to override default values? – Peter Mounce Sep 20 '12 at 10:33

2 Answers2

1

You can get all the builds for a particular project or build config like this:

http://yourserver/app/rest/buildTypes/id:your_project_id

You can filter these results to only show the most recent successful build like this:

http://yourserver/app/rest/buildTypes/id:your_project_id/?count=1&status=SUCCESS

Use a script to load the href from the build returned by the above url and you can get the "lastChanges" element, which always contains the ID of the last change.

You can then send the link below to trigger a build that will only include changes up to that ID like this:

http://yourserver/app/rest/action.html?add2Queue=your_project_id&modificationId=000000

NOTE: The ID attribute in the lastChanges element is the one you want to use as the modificationID. This is not the actual change ID from your VCS though. This is an internal Team City ID.

Brynn McCullagh
  • 4,083
  • 2
  • 17
  • 12
0

You can get list of modifications using url http://buildserver/httpAuth/app/rest/changes. You can find more info in REST API documentation.

neverov
  • 1,283
  • 8
  • 11