如何批量更新 TFS 中的多个工作项 [英] How to batch update multiple workitems in TFS

查看:21
本文介绍了如何批量更新 TFS 中的多个工作项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将 TFS 中数百个工作项的相同字段更新为相同的值.有什么办法可以批量进行,而不是手动一个一个更新?

I need to update same field to same value for hundreds of workitems in TFS. Is there any way to do it in a batch instead of updating them manually one by one?

推荐答案

您可以在 Excel 中执行此操作:

You can do this in Excel:

  1. 通过以下方式在 Excel 中打开工作项:
    • 在团队资源管理器中右键单击查询 -> 在 Excel 中打开
    • 在 WIT 结果窗格中多选一些工作项,然后右键单击 -> 在 Excel 中打开
    • 加载 Excel,使用 Team -> Import 加载预定义的查询
    • 打开一个已经绑定到 TFS 的 *.xls 文件

完整文档:在 Excel 中管理工作项(概述页面;大量&里面有很多链接)

Full documentation: Managing work items in Excel (overview page; lots & lots of links inside)

您可以在网页界面也是

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)   

这篇关于如何批量更新 TFS 中的多个工作项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆