CalendarCALENDAR
<<  July 2008  >>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
TagTAGS
Recent PostRECENT POSTS
Recent PostRECENT COMMENTS
  • Gravatar
    Keenan on No Smoking Room @ Krislounge in Changi T3
  • Gravatar
    Andre on Delete Work Item in TFS
  • Gravatar
    Satya on No Smoking Room @ Krislounge in Changi T3
  • Gravatar
    dondy on Delete Work Item in TFS
  • Gravatar
    James Scanlon on Delete Work Item in TFS
Blog RollBLOGROLL
 

Mar

31

Delete Work Item in TFS

Year 2008 | By By dondy | Permalink Permalink | Comment 3 Comments

In TFS 2008, there's a capability to delete unused work item. I know some people think that physically delete the work item is not needed because there are several work around to achieve it, nevertheless for the reason of tidiness everything, delete work item physically sometimes is required.

Out of the box, this feature is not available. You need to install TFS 2008 Power Tools and use the TFPT.EXE command line tools (although I believe GUI will be more than useful).

image

Be careful now, there's no way to recover or undelete the work item by executing this tool.

As the description suggest, using this tool is not deleting records in datawarehouse (TFS uses SQL Server both OLTP and OLAP), only in operational database. The implication is the deleted work item will still appear in Team Reporting.

To fix this, manual deletion is required in TFS Datawarehouse database, some people will say that this practice is dangerous because potentially will break the data integrity but I think if we do it properly, the risk can be eliminated.

in SQL Management Studio, connect to TFS Database Server, and then unfold TFSWarehouse database.

 

image

Notice five tables with name related to work item. [Current Work Item], [Work Item], [Work Item Changeset], [Work Item History], and [Work Item with Result].

Query [Work Item] table to get the work item id in Datawarehouse with this SQL statement

SELECT __ID, System_Title FROM [Work Item] WHERE System_Id = workitemid

workitemid in here is the work items id that is used in TFPT command. Don't get confused because in other 4 tables that previously noted the work item id that will be used is coming from [Work Item].__ID.

For the other 4 tables here's the SQL statement that need to be executed

Delete [table name] where [work item] = workitem_from_[Work Item].__ID

Then rebuilt you cube by executing the OLAP Database and Warehouse Run from web services.

 

Disclaimer : please be very careful when conducting this procedure. I am not responsible if your TFS data is messed up

Comments

James Scanlon said on 09.05.2008 12:06

James Scanlon

Hi, Nice article. I was wondering if this could cause a break in referential integrity as there may then be orphan changesets with no work Item attached to them?

dondy said on 10.05.2008 09:04

dondy

That's why you also need to delete the [Work Item Changeset] table and other table mentioned in the post.

Thanks for comment

Andre said on 15.05.2008 11:16

Andre

Well - I tried it based on your description, and it worked like charm. Thanks

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]