title: TeamCity :: How can I access teamcity build ID in Java
body: <p>Teamcity Build ID (which is different from BUILD_NUMBER) is used in various URLs. I want to send an email having path of a build's artifacts/ overview etc.</p>
  
  <p>In Java, we can get currently running teamcity build number as follows:</p>
  
  <pre><code>String tc_BuildNumber = System.getenv("BUILD_NUMBER");
  </code></pre>
  
  <p>This is because TC provides an environment variable namely BUILD_NUMBER.
  But unfortunately, there is no environment variable corresponding to BUILD_ID.</p>
  
  <p>TeamCity does provide Configuration parameters (like teamcity.build.id) and System property (like system.teamcity.auth.userId) but I don't know how to access these using Java. I want to read the value of teamCity.build.id jusy like we can read environment variables names mentioned in <a href="https://stackoverflow.com/questions/30751034/how-to-fetch-the-value-of-teamcity-configuration-in-java">How to fetch the Value of Teamcity Configuration in java?</a></p>