Custom Build Trigger development and snapshot dependencies.

Hi,

I'm developing a custom build trigger plugin as described in the documentation: https://plugins.jetbrains.com/docs/teamcity/custom-build-trigger.html 
The build configurations I'm planning to use this trigger on will all have a snapshot dependency. I need guidance on how to handle these snapshot dependencies.

Assume two build configs A and B, A with a snapshot dependency on B: When starting a build on A manually, instead of selecting 'Run' on A's build config page, we can open the page of a finished B build and select 'Promote'. This will show A left of a 'Run' button that queues an A build that will use the selected B build for it's snapshot dependency.

I would like to do a similar thing in my custom build trigger. I believe the correct way to get the SBuildType object for B from A is via jetbrains.buildServer.serverSide.dependency.DependencySettings#getDependencies()
I can then check the history for BuildConfig B (via jetbrains.buildServer.serverSide.SBuildType#getHistory() ) and select any of its builds using some custom logic. However, how would I go about adding a build of A to the queue that will use the selected B build?

Thanks

Please sign in to leave a comment.