2009-07-31 13 views

Respuesta

42

Usted puede hacer esto en Excel :

  1. Abrir los elementos de trabajo en Excel, a través de:
    • haga clic derecho en una consulta en Team Explorer -> abierto en Excel
    • multi- seleccione algunos elementos de trabajo en un panel de resultados WIT, luego haga clic derecho -> abrir en Excel
    • cargar Excel, use Equipo -> Importar para cargar una consulta predefinida
    • abrir un archivo * .xls que ya está obligado a TFS
  2. Haga su mayor edita
  3. Haga clic en el botón Publicar en la cinta Equipo

enter image description here

documentación completa: Managing work items in Excel (página de resumen; lotes & un montón de enlaces dentro)

You can bulk-edit in the web interface too

línea de comandos de 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 - ¿podría hacerlo también con tfpt workitem? –

+1

Y powershell? (Sé que quieres deslumbrar con tu l33t powershell skilz otra vez :-)) –

+1

Solo para ti, 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() 
} 

Puede descargar la secuencia de comandos detallada desde how to batch update multiple work items in TFS by PowerShell

Cuestiones relacionadas