Cómo actualizar por lotes varios workitems en TFS


Necesito actualizar el mismo campo al mismo valor para cientos de workitems en TFS. Hay alguna manera de hacerlo en un lote en lugar de actualizar manualmente uno por uno?

Author: Richard Berg, 2009-07-31

2 answers

Puedes hacer esto en Excel :

  1. Abra los elementos de trabajo en Excel, a través de:
    • haga clic derecho en una consulta en Team Explorer - > abrir en Excel
    • seleccione varios elementos de trabajo en un panel de resultados de WIT, luego haga clic con el botón derecho - > abrir en Excel
    • carga Excel, usa Team - > Import para cargar una consulta predefinida
    • abra un *.archivo xls que ya está vinculado a TFS
  2. Haga sus ediciones masivas
  3. Haga clic en el botón Publicar en el equipo cinta

introduzca la descripción de la imagen aquí

Documentación completa: Administrar elementos de trabajo en Excel (página de resumen; muchos y muchos enlaces dentro)

También puede editar en masa en la interfaz web

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)   
 42
Author: Richard Berg,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-07 21:49:46
$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 detail script desde cómo actualizar por lotes varios elementos de trabajo en TFS mediante PowerShell

 0
Author: frank tan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-18 06:14:24