Get all builds for a personal change via REST Api

Hi,

We are trying to find a way to get all the builds and the status for a specific personal patch via the REST Api. Basically, we want the same information that we get from the change page:

https://teamcityserver/change/<changeId>?personal=true&buildTypeId=<buildTypeId>&tab=builds&onlyFailed=false

We've been searching the web and trying a ton of different Api calls but could not find anything that would give use the same information as that page.

app/rest/changes/id:{changeId},personal:true/buildTypes is close, but returns only the buildTypes and not the builds.

app/rest/changes/id:{changeId},personal:true?fields=status returns the status and the failed builds, but not all the triggered builds.

Could you provide insights on how the change page gets all its information please?

Thanks!

0
3 comments

Hello Michael,

The closest I could find was this request:

/app/rest/ui/changes/id:<changeID>,personal:true/firstBuilds?fields=build(id,changes(change(id,version,username,personal)))

Could you please let me know if this helps?

0

Hi Fedor,

Thank you, this is exactly what we were looking for.

However, I must ask, why is this method not documented anywhere? I'm looking at both the Changes API documentation and the generated swagger.json for our server and there's no reference to the /firstBuilds method at all.

0

Hello Michael,

I see that the method was added for quite a while but was hidden internally which is why it never made it to swagger.json / documentation. I have double-checked it and could not find a reason to keep it hidden, so I will see to updating the documentation this week. Thank you for mentioning that!

0

Please sign in to leave a comment.