Thursday, January 8, 2009

Deleting Work Items in TFS

Many new TFS users are surprised to learn that deleting work items is not a piece of cake. Technically its possible to do. But its wisely kept from being straightforward. Making a Work Item be "deleted" means destroying history and that's not good for honesty/transparency. What's recommended is to modify the WIT template workflow to create a State called "Deleted". But if you must delete a work item there are a couple ways:

(1) Delete the work item in the database.

delete from dbo.WorkItemsLatest where ID = ?"

delete from dbo.WorkItemsAre where ID = ?"

delete from dbo.WorkItemsWere where ID = ?"

delete from dbo.WorkItemLongTexts where ID = ?"

delete from dbo.WorkItemFiles where ID =? "

Warning: You need to also possibly delete rows in the Attachments database and the work item will still be in the data warehouse.


(2) Get the latest TFS Power Tools (see
http://msdn2.microsoft.com/en-us/tfs2008/bb980963.aspx) and use the "tfpt destroywitd" command.

Warning: The work item will still be in the data warehouse as this only deletes them from the operational store.

No comments:

Post a Comment