Incorrect buildTypeId and projectId for SRunningBuild

I am creating a notifier plugin which when a build is finished, it extracts some info about the build and sends it off to a webservice as json.

However, some of the information that I'm extracting seems to be incorrect or not the same as what teamcity webui reflects.

buildTypeId, for example, which I get by calling getBuildTypeId() on the SRunningBuild returns "bt3" - this is odd because my teamcity server says that particular configuration's buildTypeId is "WindowsApps_ConsoleApplication1" (from the url: http://localhost:8000/viewType.html?buildTypeId=WindowsApps_ConsoleApplication1). Substituing bt3 in the url does not work.

The other field is the project id which I get by calling getProjectId on the SRunningBuild param. This method returns "project1" - but my project ID is actually "WindowsApps". Oddly though, "project1" will redirect to "WindowsApps" if I substitute it in the url.

Here's a snippet from the json I'm trying to send out:

  "type": "FAILED",
  "buildId": 74,
  "buildNumber": "877718",
  "buildTypeId": "bt3",
  "buildName": "ConsoleApplication1",
  "buildFullName": "Windows Apps :: ConsoleApplication1",
  "buildDescription": "C# console application",
  "buildProjectId": "project1",
  "buildProjectName": "Windows Apps",
  "buildStartTime": "Sun Jan 10 18:03:21 PST 2016",
  "buildEndTime": null,

Is there a way to get the build type id and project id exactly as they appear on the teamcity server?

Comment actions Permalink

The values you are getting are the internal ids, to get the user defined or external ids you need to use the getProjectExternalId and getBuildTypeExternalId methods.


Comment actions Permalink

That did it. Thank you :)


Please sign in to leave a comment.