问题
I'm experiencing a problem with the severity of the bug work items generated by me builds occasionally failing while using TFS 2010 (after checking in bad sources of course). My boss has decided that a build failure for my project should rank 2nd most important in the severity ladder, not first. He want to reserve the critical status for project which rake in the money, not the projects for building the codebase of our CMS. I'd still like to be notified when a build fails, but he won't allow me to keep the severity of the bug at 1 - critical, which is the default value of the generated bug work items. I've been trying to change the work item severity, but I can't seem to be able to find the location in the buildtemplate I've been using for my project. (DefaultTemplate.xaml, just the default agile team project process template) I've searched the whole template for the activity which adds a work item if the build fails, but to no avail. I suspect it is some setting in one of the activities or that it is dependent on the associate changesets and work items activity, but that activity doesn't seem to have a setting for setting a severity.
I'm not very skilled when it comes to editing these build templates, but so is noone else over here, so I'm it.
I've found a blog which claims you can change this, but the template used seems to be different from the one I use. http://geekswithblogs.net/jakob/archive/2010/04/28/modify-build-failure-work-item-in-tfs-2010-build.aspx
I've tried finding the IfCreateWorkItem activity mentioned in the blog post in the build template, but I can't find it.
Also I'm unsure if adding the work item activity will prevent the critical item from being posted. I suspect it will add a new work item in case of failure in addition to the other work item unless I turn off the associate changesets and work items setting, which I don't want. (if tests pass I want the associated work items to change state to passed too)
Related to this matter is the person to whom the bug is assigned.currently this is the NTAuthority account. I'd like to change that to the person who submitted the last changeset used for the build. I Can't find a setting for that either.
回答1:
If you find the "Create Work Item" step of the Template:
Right click on this and do "Properties" in the Properties window you will see a "CustomFields" that can be edited. Click the "..." elipsis to open the Expression editor:
From there you can adjust the properties.回答2:
I needed to make the same change and couldn't find the "Creat Work Item" section either, at first. You have to expand (double-click) the Exception section of "Try to compile project".
来源:https://stackoverflow.com/questions/6667039/tfs-2010-set-bug-work-item-severity-after-build-failure