Access teamCity Build number in Java


I am running my automation test suite from TeamCity. I need to access the buildId property as I have a situation where I have to construct a file path using this buildId.

I tried using System.getProperty("")  but it just displays null.  How can I access the buildID of the current team city run from my java code.

1 comment
Comment actions Permalink


TeamCity parameters are passed to environment or to the supported build script engines. For more details please see the related section in the documentation. 

Please try the following:


Please sign in to leave a comment.