Jeff Bramwell

I have several build types for one of our Team Projects - one of the build types is a Continuous Integration (CI) Build that is called each time a changeset is checked in then we have a "System Test" (ST) build that is scheduled to run nightly.

I am attempting to build two queries - one that lists all Work Items that have only been included in the CI build and another query that lists all Work Items that have been included in the nigtly ST build.

My initial query was checking the State field for a value of "Resolved" and then checking the IntegrationBuild property to see if it contained the specific build type name in the text.

The problem I'm having is that the IntegrationBuild (i.e. Resolved in Build) field does not always seem to get filled in. Then, when it is filled in from the CI build, it seems that it never gets updated to the nightly ST build (which may be by design).

So, with all that said, does anyone know how I can query a Work Item and tell which build type was last executed that contained a changeset with an association to the Work Item Is there anything I can do within the build script itself to set a property




Re: Team Foundation Server - Work Item Tracking Associating WI with Build

Jeff B.

I'm still looking for a way to achieve this. Does anyone know if there is a build task that can be used to update all Work Items associated with the changesets included in the build For example, if I could programatically (within the build script) update a Work Item field (either a standard field or a custom field) during the build, then I could base my query off that.

Any ideas






Re: Team Foundation Server - Work Item Tracking Associating WI with Build

Jason Pricket - MSFT

Hi Jeff,

It sounds like you need a custom build task. Team Build uses an msbuild task to update the work items fixed by the build. You could do something similar in your own custom task. To find out more on writing a custom task see Aaron's blog. To learn more about the Work Item Tracking Object Model, see MSDN.

If you have any specific questions about how to create this custom task please post them on the Build Automation forum (so we don't miss them).

We can't share the code for our built-in task that updates the work items, but we can answer the questions you might have.

Thanks,

Jason





Re: Team Foundation Server - Work Item Tracking Associating WI with Build

Jason Pricket - MSFT

Hi Jeff,

I just wanted to clarify something. You said "it seems that it never gets updated to the nightly ST build (which may be by design)". That behaviour is NOT by design. I tried the same thing with Version 1 SP1 and our Orcas Beta1. On both those versions the work item field was overwritten by the last build that happened. It sounds like something else is happening in your ST build. Make sure that it is not skipping the work item update. But you should get the behaviour that you desire.

Let us know how it goes,

Jason





Re: Team Foundation Server - Work Item Tracking Associating WI with Build

Jeff B.

Jason,

That was it exactly - somehow I must have changed the <UpdateAssociatedWorkItems> element to "false". Once I changed it back to "true" it started working as expected.

Thanks again for your help.