TeamCity - CI and Overnight Build Numbers


This has been discussed before but some years ago now.  With the latest 8.1 build, is there a way for my CI build to use the Overnight build number as a part of it's own version number?  For example, our Overnight build produces a version number of 1.0.%build.number%.  What I would like is for our CI build to use, so that it essentially reads or something, i.e. the first three digits of the CI build match that from the last successful overnight build.

Tomorrow for example the CI would be v1.0.2.1, counting up to (for example) v1.0.2.10 that day, swapping to v1.0.3.1 the next day.

Any ideas?  Could this be achieved through artifacts perhaps?

Comment actions Permalink

Any suggestions?

Comment actions Permalink

Hello, you can only use parameters from builds this one has snapshot dependency to (both direct and indirect). In this case you can use parameter %dep.<conf_name>.build.number%.

If there's no snapshot dependency, you can retrieve the build.number of the latest build via REST
see for details
and then set this number in build using service message:

So, you need to find the way to retrieve the build number inside your script.

Alternatively, in your nightly build, as a last build step, you can setup a build number parameter to daily configuration via REST API ( and


Please sign in to leave a comment.