I got a problem trying to develop a custom activity for a TFS template in TFS 2013. My first step is to get the changesets associated with the build. And after a lot of tries and google I have always the same problems : my list is empty. My last attempt is from this article : http://www.colinsalmcorner.com/post/tfs-2013-default-build--the-getenvironmentvariablet-activity
Whatever I tried, in my custom activity I've always nothing.
public sealed class ChangeLogActivity : CodeActivity<IList<Changeset>>
{
[RequiredArgument]
public InArgument<IList<Changeset>> AssociatedChangesets { get; set; }
protected override IList<Changeset> Execute(CodeActivityContext context)
{
IList<Changeset> list = context.GetValue(this.AssociatedChangesets);
// list is empty, but not null
}
}
In my template, it's what I got :
Then my variables,
Then the property of GetEnvironmentVariable task
And Finally the properties of my activity
I don't know what I'm missing. Plus, I don't know if it's related, even my TrackBuildWarning do nothing. I thought my context was not the good one, but how to verify it ?
I knew that just after posting my question I'll find the answer. Simply, if between 2 successful builds no checkin was made, AssociatedChangeset will always be empty.
I can understand why, the build display is very tricky. It says at the top "build was started by blabla with associated changeset 14"
So I supposed wrongly that I can always get this information...