Ken*_*Yao 30 api powershell tfs bug-tracking
我需要将相同的字段更新为TFS中数百个工作项的相同值.是否有任何方法可以批量执行而不是逐个手动更新?
Ric*_*erg 42
您可以在Excel中执行此操作:

完整文档: 在Excel中管理工作项(概述页面;内部有很多链接)
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"
Run Code Online (Sandbox Code Playgroud)
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)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11683 次 |
| 最近记录: |