1
votes

I am extending a gated build to integrate with a 3rd party system. What I'd like to do ultimately is send the changeset id and list of changed files to this system.

Following Jim Lamb's post (http://blogs.msdn.com/b/jimlamb/archive/2009/11/18/how-to-create-a-custom-workflow-activity-for-tfs-build-2010.aspx) I've added an activity to connect to the other system and added it to my build definition xaml after the checkin gated changes activity.

My question is, how do I get the information about this specific build that I need in my custom activity?

1

1 Answers

1
votes

From your question, it seems like you want to specifically get the list of changesets that are checked in by the gated build, and from then get the list of changed files.

In TFS 2010, the CheckInGatedChanges does not give you the list of changesets it committed the check-ins, so you will need to rely on the build information nodes that were created when a checkin occurs.

From your custom activity, you can get the IBuildDetail object from the workflow, then use it to query for the build information nodes with type CheckinOutcome. You can read two fields "ChangesetId" and "CheckInCommitted" from this information node. Make sure CheckInCommitted is equal to "succeeded".

To get the IBuildDetail object from the workflow, you need to add an InArgument property to your custom activity:

        public InArgument<IBuildDetail> Build { get; set; }

Then in your code activity, use:

        IBuildDetail build = Build.Get(context);

If you are creating a composite activity, you can use GetBuildDetail activity to get the IBuildDetail object.

Hope it helps.