3

I think I may have misunderstood the purpose of this function, but here's my problem.

When I look in the build summary, I see that a build ran successfully, and it tells me:

[person] triggered [build number] ([project]) for changeset 123456

I have the following code, which runs in a console app to tell me what changesets were included in a build.

IBuildDefinition[] result = buildServer.QueryBuildDefinitions(teamProj.Name);
foreach (IBuildDefinition def in result)
{
    IBuildDetail[] dets = def.QueryBuilds();

    foreach (IBuildDetail det in dets)
    {
        det.RefreshAllDetails();

        // Get changesets for the buildList<IChangesetSummary> 
       changes = InformationNodeConverters.GetAssociatedChangesets(buildDetail);
       foreach (IChangesetSummary changeset in changes)
       {

       }
    }
}

The problem is that this returns nothing. The Information propery has 6 nodes, none of which relate to a changeset or a workitem. Why does VS2010 build summary tell me that I have an associated changeset, but the code below tells me different?

Paul Michaels
  • 16,185
  • 43
  • 146
  • 269

1 Answers1

2

What is the state of the build? (Successful, Failed, or Partially Succeeded)? Also, which build process template are you using? Are you using the default build process template and if you are have you made any updates to it? There are a few things that you have to make sure you keep in place if you customize the build to get the AssociateChangesetsAndWorkItems build activity to work properly.

I helped Andy Lewis with some of that information here: http://blogs.msdn.com/b/andy-lewis/archive/2011/01/31/how-good-was-that-build.aspx

The string you mentioned isn't actually what indicates that there are associated changesets. On the build summary screen, you should see a section that says "Associated Changesets." If you don't, then that usually is the first sign that there is a problem.

Let us know some additional information and I'll be happy to help!

Ed Blankenship
  • 5,235
  • 1
  • 31
  • 31
  • This looks like the problem - despite the fact that the build summary reports an associated change set, there weren't any. The problem being that the last action on this branch before the build was that it was branched (for release) - so TFS does not recognise the branch as a change. – Paul Michaels Mar 31 '11 at 10:18
  • My issue was that InformationNodeConverters.GetAssociatedChangesets returned nothing for builds that weren't successful. Now I'm trying to find out how to show those... (But changesets were returned for good builds.) – Bob Horn Dec 08 '11 at 21:58