2009-07-31 6 views

Répondre

42

Vous pouvez le faire dans Excel:

  1. Ouvrez les éléments de travail dans Excel, via:
    • clic droit une requête dans Team Explorer -> ouvert dans Excel
    • multi sélectionnez des éléments de travail dans un volet de résultats WIT, puis faites un clic droit -> ouvrir dans Excel
    • charge Excel, utilisez l'équipe -> Importer pour charger une requête prédéfinie
    • ouvrir un fichier * .xls qui est déjà lié à TFS
  2. Faites votre gros modifications
  3. Cliquez sur le bouton Publier sur le ruban d'équipe

enter image description here

Documentation complète: Managing work items in Excel (page de vue d'ensemble; Lots & beaucoup de liens à l'intérieur)

You can bulk-edit in the web interface too

ligne de commande 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 - pourriez-vous le faire aussi avec tfpt workitem? –

+1

Et PowerShell? (Je sais que vous voulez éblouir encore une fois avec votre PowerShell l33t :-)) –

+1

Rien que pour vous, 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() 
} 

Vous pouvez télécharger le script de détail à partir de how to batch update multiple work items in TFS by PowerShell