2009-07-31 129 views

回答

42

您可以在Excel中此:

  1. 在Excel中打開工作項目,通過:
    • 右擊團隊資源管理器的查詢 - >在Excel
    • 多開在WIT結果窗格中選擇一些工作項,然後右鍵單擊 - >在Excel中打開
    • 加載Excel,使用Team - > Import加載預定義查詢
    • 打開已經綁定到TFS
  2. 讓您的批量編輯
  3. 點擊發布的團隊功能區按鈕

enter image description here

完整文檔A * .xls文件: Managing work items in Excel (概述頁面;很多&很多鏈接內)

You can bulk-edit in the web interface too

Windows命令行

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) 
+0

理查德 - 你能用tfpt workitem來做嗎? – 2009-07-31 12:37:40

0
$secpasswd = ConvertTo-SecureString $TfsPasswd -AsPlainText -Force 
$mycreds = New-Object System.Management.Automation.PSCredential ($TfsUserName, $secpasswd) 
Connect-TfsTeamProjectCollection -Server $TfsServerUrl -Collection $TfsCollection -Credential $mycreds 
#Get-TfsTeamProject 

Connect-TfsTeamProject -Project $TfsProjectName 
$workItems = Get-TfsWorkItem -Filter "[System.WorkItemType] = 'Bug' AND [System.AssignedTo] = '$TfsUserName'" 
foreach ($workItem in $workItems) 
{ 
    $tpc = $workItem.Store.TeamProjectCollection 
    $id = $workItem.Id 
    $store = $tpc.GetService([type]'Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore') 
    $wi = $store.GetWorkItem($id) 
    $projectName = $wi.Project.Name 
    foreach($fldName in $Fields.Keys) 
    { 
     $wi.Fields[$fldName].Value = $Fields[$fldName] 
    } 
    $wi.Save() 
} 

您可以從how to batch update multiple work items in TFS by PowerShell下載詳細腳本