2009-07-31 9 views

risposta

42

È possibile farlo in Excel:

  1. Aprire gli elementi di lavoro in Excel, via:
    • tasto destro del mouse una query in Team Explorer -> Apri in Excel
    • multi- seleziona alcuni elementi di lavoro in un riquadro dei risultati WIT, quindi fai clic con il pulsante destro del mouse -> apri in Excel
    • carica Excel, usa Team -> Importa per caricare una query predefinita
    • aprire un file * .xls che è già destinata a TFS
  2. Fai la tua massa modifica
  3. clic sul pulsante Pubblica sulla barra multifunzione squadra

enter image description here

La documentazione completa: Managing work items in Excel (pagina panoramica; lotti & un sacco di link all'interno)

You can bulk-edit in the web interface too

riga di comando di 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

Richard: potresti farlo anche con il workfile? –

+1

E PowerShell? (So ​​che vuoi abbagliare ancora con il tuo SkillZ Powerhell di nuovo :-)) –

+1

Solo per te, Martin :) –

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() 
} 

È possibile scaricare lo script di dettaglio da how to batch update multiple work items in TFS by PowerShell