John Neville
John Neville

Reputation: 424

Getting Changesets in build process workflow activity

I have a custom Code Activity that sends out a status email at the end of the build process. So far I have it working except I cant seem to get the Associated Changesets and Work Items.

Right now I am using the code below to try to get the changesets and work items but it is returning an empty List.

IList<IChangesetSummary> changesetSums = InformationNodeConverters.GetAssociatedChangesets(buildDetails);
IList<IWorkItemSummary> workItemSums = InformationNodeConverters.GetAssociatedWorkItems(buildDetails);

My CodeActivity is being run well after the AssociateChangesetsAndWorkItems activity has run and finished and the changesets and Work items show up in the build summary in Visual Studios.

Upvotes: 1

Views: 1243

Answers (1)

Daniel Balas
Daniel Balas

Reputation: 1850

The problem is, that IBuildDetail somehow does not get updated until the whole build is finished, either you use reference available in build process itself or query a new IBuildDetail separately. I have tried both when executing Powershell script near the end of the process (the behavior was the same both on agent and on controller).

The solution I have made was to use associatedChangesets variable, which contains result of AssociateChangesetsAndWorkItems activity in the default process template. This gives you an array of associated changesets.

Obtaining associated work items would then be easy, since this information should be already present. However, I have not tested this, since I did not need work items.

Upvotes: 2

Related Questions