9

Can someone please tell me how I can get the changeset number, the current build of TFS 2010 was triggered for?

I want to extend the build worklfow if the build was triggered by a checkin and want to do some more processing for which I need the changesetnumber of the changeset that was created by the checkin.

Any ideas?

Kara
  • 6,115
  • 16
  • 50
  • 57
Scordo
  • 1,041
  • 7
  • 12

2 Answers2

16

I found the Solution. The Changesetnumber for which the build is triggered is populated in the Variable: BuildDetail.SourceGetVersion

Scordo
  • 1,041
  • 7
  • 12
  • I see the reference info for this property. How can I access the sourcegetversion inside my C# code so I can compile the version# into the executable? – Stephen Gross Oct 31 '11 at 18:50
1

Using an extension from http://msbuildtasks.tigris.org/, you can do this with the TfsVersion task in the Build project:

   <MSBuild.Community.Tasks.Tfs.TfsVersion LocalPath="$(SolutionRoot)">
      <Output TaskParameter="Changeset" PropertyName="Revision" />
    </MSBuild.Community.Tasks.Tfs.TfsVersion>
Russ
  • 4,091
  • 21
  • 32
  • Thx but I said that i want to extend the --> workflow <--. The time where I need the changesetnumber is within the phase where the workflow is not running on a selected agent. – Scordo Aug 19 '10 at 12:25