TFS作業項目を完全に削除するコマンドラインツールがあることは承知しています。(例: Team Foundation Server から作業項目を削除する方法)
TFS 2010 API DLL を使用してプログラムで同じアクションを実現できた人はいますか?
TFS作業項目を完全に削除するコマンドラインツールがあることは承知しています。(例: Team Foundation Server から作業項目を削除する方法)
TFS 2010 API DLL を使用してプログラムで同じアクションを実現できた人はいますか?
Shai Raiten は、このことについてブログを書いていますDestroyWorkItems(ids)
。
これにより、インストールが大幅に混乱する可能性があるため、実装には細心の注意を払うことをお勧めします。このようなツールを構築することは、ベスト プラクティスから逸脱していると主張する人もいるでしょう。
PowerShell を使用して作業項目を一括削除することもできます。
以下のスクリプトをコピーして PowerShell ファイル (拡張子は .ps1) に貼り付け、下のリスト #4 に記載されている変数値を更新し、witadmin ツールがインストールされているマシンからコマンドを実行します (Visual Studio のインストール後に一般的に利用可能になります)。PowerShell コマンド ウィンドウを開き、スクリプトを実行します。注: 以下のスクリプトを実行するアカウントには、Team Foundation 管理者またはコレクション管理者のアクセス権が必要です。
########TFS Work Items Bulk Destroy Automation Script########## #Notes: #1) This script requires to setup file/folder path, validate the file/folders path before running the script #2) start the powershell window as Administrator and run the script #3) This script requires share and admin access on the destination server, make sure your account or the account under which script is # executing is member of admin group on the destination server #4) Update following: # 4.1: $CollectionURL # 4.2: $WitAdmin tool location # For VS 2015, Default location is C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE # For VS 2013, Default location is C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE # 4.3: $WI_List # 4.4: $logfile #################### $CollectionURL = "http://tfs:8080/tfs/CollectionName" $WitAdminLocation = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" $WI_List = Get-Content "C:\WI_List.txt" $logfile="C:\log.txt" $ExecutionStartTime = Get-Date $WICount = 0 "## Starting WI Destroy @ $ExecutionStartTime ##"| Out-File $logfile -Append "Collection URL: $CollectionURL" | Out-File $logfile -Append foreach ($WIID in $WI_List) { CD $WitAdminLocation .\witadmin destroywi /collection:$CollectionURL /id:$WIID /noprompt "WI ID: $WIID Destroyed" | Out-File $logfile -Append $WICount = $WICount + 1 Write-Host "$WICount Work Items Deleted" } $ExecutionEndTime = Get-Date "## WI Destroy Command Completed @ $ExecutionEndTime ##"| Out-File $logfile -Append $TotalExecutionTime = $ExecutionEndTime - $ExecutionStartTime "Total Work Items Deleted: $WICount" | Out-File $logfile -Append " Total Execution Time: $TotalExecutionTime" | Out-File $logfile -Append ##End of script##