Rest API retrieving the next build number

Hi all,

I'm new to using Teamcity and I was wondering if there was any way of retrieveing the next build number for a build via the rest API. I've had a look but can't see anything, but wanted to check in case i'd missed something.
If not does anyone know how to get the next build number without having to go to the settings page. At the moment i'm not using any complex build numbers so its just {0}.

Cheers for any help.

4 comments
Comment actions Permalink

Hi Daniel

This value is not exposed in REST API.
Can you provide an example, how are you going to use it?

Thanks
Michael

0
Comment actions Permalink

We are currrntly using TeamCity to manage builds for a team of about 25 people, all of whom are working on features and resolving bugs for our product. As part of our bug system we specify the build number that the bug will be fixed in. But due to milestone builds and one off builds the build number isnt alway sequential. So I was hoping to modify something like Buildscreen to display the next build number, as granting every user the rights currently required to see the next build number seems like a poor plan.

Unless of course there is a way to display that information on the team city web interface.

Cheers
Dan.

0
Comment actions Permalink

If you have access to TeamCity server's file system then easiest way will be to read these counters right from Data Directory.
They are stored inside \config\<project>\bt<id>.buildNumbers.properties

And by the way, YouTrack can fill such "fixed in build" properties automatically :)

0
Comment actions Permalink

Daniel,

Just FYI: in next EAP of TeamCity 7.0 you will be able to get current build counter value with REST API:
GET to http://user:pass@teamcity.server.url/app/rest/buildTypes/id:<btXXX - internal id of the build configuration>/settings/buildNumberCounter

0

Please sign in to leave a comment.