4 Replies Last post: Jan 18, 2012 10:57 PM by Yegor Yarko  
Daniel Hallifax Newbie 2 posts since
Oct 4, 2011
Currently Being Moderated

Oct 4, 2011 6:24 PM

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.

Michael Kuzmin JetBrains 1,227 posts since
Jul 30, 2005
Currently Being Moderated
Oct 18, 2011 3:02 PM in response to: Daniel Hallifax
Re: Rest API retrieving the next build number

Hi Daniel

 

This value is not exposed in REST API.

Can you provide an example, how are you going to use it?

 

Thanks

Michael

Michael Kuzmin JetBrains 1,227 posts since
Jul 30, 2005
Currently Being Moderated
Oct 20, 2011 6:15 PM in response to: Daniel Hallifax
Re: Rest API retrieving the next build number

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

Yegor Yarko JetBrains 1,458 posts since
May 5, 2004
Currently Being Moderated
Jan 18, 2012 10:57 PM in response to: Daniel Hallifax
Re: Rest API retrieving the next build number

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

More Like This

  • Retrieving data ...