getting the projectId

Hi all,

in a html page (that is generated during the build run) I would like to add a link to the test history page, like
   href="/project.html?projectId=project2&testName=test.Suite.test: Class.method&tab=testDetails"
this works with the fixed projectId. But is there a way to get the project id of the current build ?

There's a TEAMCITY_PROJECT_NAME env variable, but using projectName= or projectId= doesn't work.

1 comment
Comment actions Permalink


Project ID is not passed into the build (feel free to file a request on this into our tracker).
For now you have the options:
- manually add a property in to the build configuration with the project id. Will work until you move the build configuration into another project.
- write your own plugin to add a property automatically (it's really just like adding several lines to the groovyPlug plugin)
- use REST API to get the id from the build script: http://<your_server_URL>/httpAuth/app/rest/projects/name:<URL-escaped_project_name_goes_here>/id . But for this you will need to hard-code server URL and username/password to get access to the request.

Just in case, I've filed a feature request to support URLs without project ID.


Please sign in to leave a comment.