Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to batch update multiple workitems in TFS

I need to update same field to same value for hundreds of workitems in TFS. Is there any way to do it in a batch instead of updating them manually one by one?

like image 359
Ken Yao Avatar asked Jul 31 '09 03:07

Ken Yao


People also ask

How do I edit multiple work items in Azure DevOps?

To start a bulk edit, begin by multi-selecting the work items you want to modify, either from the query results or the backlog. You can craft your query using the query editor or search box. Multi-select of work items on the backlog and sprint backlogs works in the same way as multi-select works within query results.

How do I change the parent of a task in Azure DevOps?

In your case, the simplest way is from the product backlog you can multi-select several work items and choose Change parent… to link the items to a parent work item. You need also view Parents or a tree hierarchy, choose the view options icon and slide Parents to On.


1 Answers

You can do this in Excel:

  1. Open the work items in Excel, via:
    • right click a query in Team Explorer -> open in Excel
    • multi-select some work items in a WIT result pane, then right click -> open in Excel
    • load Excel, use Team -> Import to load a predefined query
    • open a *.xls file that is already bound to TFS
  2. Make your bulk edits
  3. Click the Publish button on the Team ribbon

enter image description here

Full documentation: Managing work items in Excel (overview page; lots & lots of links inside)

You can bulk-edit in the web interface too

Windows command line:

REM make Martin Woodward fix all my bugs tfpt query /format:id "TeamProject\public\My Work Items" |      tfpt workitem /update @ /fields:"Assigned To=Martin" 

Powershell:

# make Bill & Steve happy $tfs = tfserver -path . -all $items = $tfs.wit.Query("     SELECT id FROM workitems      WHERE [Created By] IN ('bill gates', 'steve ballmer')") |      % {         $_.Open()         $_.Fields["priority"].value = 1         $_     } # note: this will be much faster than tfpt since it's only one server call $tfs.wit.BatchSave($items)    
like image 87
Richard Berg Avatar answered Oct 03 '22 05:10

Richard Berg