How to get Internal build id?

I am trying to use the API to pin a build automatically but it seems I need access to the

internal_build_id, list under Yegor's comment:

I followed this thread which might do what I need, but I just wanted to check to see if there was a better way to achive this or access the buildId?

I have a build task that calls a task that runs some tests and that in turn calls a publish task.  I need a way to pin the build task after success of the publish taks, so the undocumented REST API to pin a build is exactly what I need.  I am struggling to access the buildId of the build task from the publish task in an automated way.
The publish task sometimes fails for good reason such as another build dependecy boke.  The problem is that other builds are dependent upon the build task, and when the publish task fails, they get out of sync and cause us major problems.  I wan the configurations that are dependent on the build task, to only use the latest pinned build to ensure everything matches up.

thanks in advance.Jason



Not sure if I understand the question. If you have snapshot or artifact dependency you can use dependency properties provided by the builds the current build depends on. Please see details at

If it's not what you need, please describe you project setup in details.



Hi Marina,

The problem is that I need to access an internal property that isn't exposed in the TC predefined properties.  I did get Pavel's code to work ( I referenced his post in the previous thread), but I was looking for an easier way. So basically to get this to work, I had to deploy Pavel's plugin to gain access to the internal build id, then I had to invoke an unsupported API call to actually pin the target build.
I think I will go ahead an make a request for a supported and more simple way to pin/tag a build if there isn't one already in the system.  It would also be nice to have the option to recursively pin builds so that all dependencies got pinned in the build chain. This would be a huge help to us.



For you original issue handling a build for which publish task fails - can you make all your other builds depend on publish task and not on "build task"? e.g. you can "republish" artifacts in publish task if you use artifact dependencies.

Also, you can probably perform the publishing task in the same build as "build task" so that it's status will be successful only on successful publishing.

As to your questions:
Do you pin the "build task" form the publish build?
If yes, you need to get build id form the "build task" and this can be not that easy (you can vote for TW-4296). Currently you can save value of property "" avaialble inside the build into build's artifacts and then get the artifact to parse the id out via artifact dependencies in "publishing task".


Please sign in to leave a comment.