Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>witadmin is not part of TFS Power Tools and should be available from the Visual Studio Command Prompt on the default instalation of Visual Studio and Team Explorer.</p> <p>If for any reason it isn't available, you should be able to find it at "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE" or an equivalent path in case Visual Studio was installed elsewhere.</p> <p>There shouldn't be any spaces between the parameter name and the parameter itself and multiple IDs can be specified by delimiting them with commas:</p> <pre><code>witadmin destroywi /collection:host\collection /id:3,5,7 </code></pre> <hr> <p><strong>EDITED to include new requirements from the OP</strong></p> <p>If you need more flexibility in determining what work items are to be destroyed, you should resort to Team Foundation's client API. In the sample below, I created a console application that receives two parameters: The Team Project's name and a WIQL query:</p> <pre><code>using System; using System.Linq; using Microsoft.TeamFoundation.WorkItemTracking.Client; namespace DelWi { class Program { static void Main(string[] args) { var store = new WorkItemStore(args[0]); WorkItemCollection workItems = store.Query(args[1]); if (workItems.Count == 0) { Console.WriteLine("No work items with the specified criteria."); } var query = from workItem in workItems.Cast&lt;WorkItem&gt;() select workItem.Id; foreach (var item in store.DestroyWorkItems(query)) { Console.WriteLine("{0}\t{1}", item.Id, item.Exception.Message); } Console.WriteLine("Press any key to continue..."); Console.Read(); } } } </code></pre> <p>Once compiled you can call it passing the parameters such as in:</p> <pre><code>DelWi.exe "host\defaultcollection" "SELECT * FROM WorkItems WHERE [System.TeamProject] = 'The Best Team Project Ever' AND [System.WorkItemType] = 'Test Case' AND [System.Id] &gt; 34 AND [System.Id] &lt; 37" </code></pre> <p>Be careful though, because if you don't specify the query correctly you may end up deleting more work items than you want.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload