2009-07-31 94 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下载详细脚本