Custom workitem not created on build failure.

We have created a custom workItem called Build Failure and changed the Microsoft.TeamFoundation.Build.targets

WorkItemType to create this type of workitem when a build fails. Our nightly builds run under the TFSSERVICE user. When the builds fail no work item is created and I can't find anywhere in the logs that says it couldn't create one. When I run the build locally and it fails a Build Failure workItem is created just fine. I first assumed that it was a permissions problem but TFSSERVICE and I have the same permissions. So, to recap: nightly builds do not create custom work item when they fail. Local builds create workitems when they fail. Any Ideas?

[679 byte] By [JeffSessions] at [2008-1-4]
# 1

I'd recommend not modifying Microsoft.TeamFoundation.Build.targets. It's not intended for customization, and it will be replaced when you upgrade to the next version. You can specify the work item type and fields in the tfsbuild.proj file.

When you run the build locally, are you running msbuild on the tfsbuild.proj file or something different?

Buck

BuckHodges at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 2

I undid the changes i made to the Microsoft.TeamFoundation.Build.targets and added the <WorkItemType> to the build project file and strangly it seems to work now. the only way to know for sure is to fail the nightly builds and see if a work item is created. I will test this tonight and post my results tomorrow.

Thanks.

JeffSessions at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 3

it still doesn't create a work item in the nightly build. It's strange that if I log on to the build server and run the same script the nightly build runs it will create a work item, but the nightly builds alone do not. I'm going to try logging on with the TFSSERVICE account and run the script.

Update: After running the build logged on as TFSSERVICE it did not create a work Item. I think this is a permissions problem. TFSSERVICE is an Admin on the build server and the Database. Any ideas?

JeffSessions at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 4

I solved the problem, but it still doesn't really make sense. After the build the assemblies are copied to another server. The TFSSERVICE account did not have permissions to write to this folder. So, the "AfterDropBuild" failed which I guess stops it from creating a workitem? If the "AfterDropBuild" fails shouldn't that just be part of the information on the workitem? But, it works now so Thanks.

JeffSessions at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 5

The issue here has to do with the ordering of targets - the CreateWorkItem target comes after the DropBuild target, so if a build failure occurs during DropBuild the CreateWorkItem target is never executed. If you mark any tasks in your AfterDropBuild target override with ContinueOnError=true any errors encountered will be converted to warnings and the CreateWorkItem target should still be reached.

-Aaron

AaronHallberg-MSFT at 2007-9-26 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified