tags:

views:

260

answers:

1

Hello,

I'm looking to get the Build Number or Build Name of what Builds a particular ChangeSetID will trigger. I see there's a TfsWarehouse.dbo.[Build Changeset] table, but the TfsWarehouse DB is only populated every so often, I need this information after the TFS CheckIn Alert is fires. I've created a Check In Service that creates Code Review Work Items based on Application and assigns them to their Application Owner.

Is there a way to get at what Build will kickoff based on a ChangeSetId?

I'm ok with using the TFS API or querying the DB directly.

Thanks, Tim

+3  A: 

If you want to know what build definitions will be affected by a set of version control paths then take a look at the IBuildServer.GetAffectedBuildDefinitions method in the TFS API.

For the BuildDefinition, you can get the BuildDetails of the builds that have ran and query from them what changeset they were based on.

When the check-in event fires, it is not possible to know what the build number will be of the build that gets created from it as build numbers can be set as part of the process when a build is running - not when the build is first queued.

If you wanted to edit your question to explain what you are trying to accomplish I might be able to suggest a better way. For example on IBuildServer you can call the CreateQueuedBuildsView method to give you a mechanism for querying the build server and have your code get notified when builds are queued. There is also the BuildCompletedEvent which fires when builds finish.

Martin Woodward