Working around not being able to delete a work item type


The following question came up in the forum:  “How do I delete the custom work item type that I created?”  Tony Edwards posted the following.  One other thing that comes to my mind is to have a second server to use for experimentation before applying changes to the production server.

It is not possible in v1 [to delete work item types].  This question came up recently and Bill Essary gave the following guidance for mitigating the problem:

 Here are a few things that you can do:

 1)   Change the name of the type to something like “(Deprecated) Bug” so that users know not to use it

 2)    Add an attribute to the WIT that stops users from creating a new Work Item of that type.  If your initial workflow state is “active,” the attribute would be added to this transition

      <TRANSITION from=”” to=”Active” not=” “[global]Team Foundation Valid Users”>

[Update 8/21/06]  Unfortunately, work item types cannot be renamed in v1, so #1 above is incorrect.

[Update 4/17/09]  In TFS 2008, you can delete work items and work item types using the destroyWI and destroyWITD commands in tfpt.exe in Team Foundation Server Power Tools for 2008.

Comments (6)

  1. Rob Caron blogs about the Team System Friday Morning Briefings.  He also talks about Project Server and…

  2. James Dykes says:

    I’ve tried the transition security and i’m sorry to say that it doesn’t work. It does stop the users from saving the work item type but they can still create them.

    I get the error "the field state contains a value that is not in the list of supported values" when trying to save.

    is this what should happen or should it fail on the actual creation of the work item?

    also adding a message like "Depricated" simply duplicates the work item type in the list of available types thus giving a separate depricated bug and a bug type.

    I’ve found that the easiest way to kill off a work item type at present is to mark all possible fields with the <EMPTY /> attribute and upload via witimport.

  3. Tony Edwards MSFT says:

    That is correct.  The transition security workaround will prevent workitems of that type from being saved to the server.  It will NOT prevent the user attempting to create an item of that type in the UI.  The UI will try to create any type that is in the list of work item types for the project.  I would recommend in addition to the transition security (or other similar workaround) changing the form to be empty save perhaps a field with a defaulted value indicating that items of the type can no longer be saved.

  4. Helder says:

    Syntax correction:

    <TRANSITION from="" to="Active" not="[global]Team Foundation Valid Users">

  5. Brett Ridenour says:

    I just downloaded the Team Foundation Power Tools 2010 RC and have the Team Foundation 2010 RC installed, to my dismay it looks as thought the "destroywitd" is not longer supported by the power tools.  Have I done something wrong?

  6. buckh says:

    Brett, that’s right.  It’s now part of the product in TFS 2010 using the witadmin command: http://msdn.microsoft.com/en-us/library/dd236914.aspx.

    Buck