How to Reset the the build counter if the vcs branch is different on next builds

HI ,

Is there anyway we can let the Teamcity build counter to reset to 1 automatically when the VCS trigger pulls the new branch to build.


lets say Branch1 with build counter of 1 gets build generated .

and when we cut the new branch lets say Branch2 , we wanting the build counter to reset to 1 instead of incrementing to 2 since its different branch from last build.




1 comment



In your scenario, if after branch 2 is triggered, branch 1 gets a new commit, branch 1 would be again either build number 1 (because build counter is reset) or build number 2 (as there was a previous build in branch 1 or 2), would that be desired?

From your question, it would seem that you would like to have the build counter track branches separately. This is not doable directly, but you could simply extract a template of your build configuration, then for each branch you want to have a separate tracker, have a build configuration using the template. You will need to replicate this process for each branch that should have a separate counter.


Please sign in to leave a comment.