A way to find out all affected files of a workItem or group of chgsets in TFS 2008?

匆匆过客 提交于 2019-12-04 06:29:48

Sounds like a job for Powershell...

function Get-TfsItem([int] $workItemNumber)
{
    Get-TfsServer njtfs -all |
        foreach { $_.wit.GetWorkItem($workItemNumber) } |
        foreach { $_.Links } |
        foreach { ([regex]'vstfs:///VersionControl/Changeset/(\d+)').matches($_.LinkedArtifactUri) } |
        foreach { $_.groups[1].value } |
        Get-TfsChangeset | 
        Select-TfsItem |
        Sort Path -Unique 
}

The first several lines are kind of ugly. We have to hit the webservice API directly since the TFS cmdlets don't cover the bug tracking system. And the objects we get back require some regular expression love before they'll do what we need. Piping to "foreach" over & over is an unfortunate Powershell idiom that arises when you mate an unfriendly API to a lame projection operator. (I use my own replacement, personally, but you can't rely on that.)

The last 3 lines should be self explanatory if my TFS Power Cmdlets are installed & doing their job.

I just found Scrum Power Tools plugin for VS 2010 that does this with a button click in VSS, installed and it worked. http://visualstudiogallery.msdn.microsoft.com/3f261226-530e-4e9c-b7d7-451c2f77f262

I am just trying to make the powershell version 2010 work. http://msdn.microsoft.com/en-us/vstudio/bb980963

First problem is that the pwoer shell option is not installed by default, use custom install and select that option. When completed there is a powershell prompt in the TFS powertools 2010 menu, the commands only work in there.

The get server I had to replace njtfs with the url http://tfsserver:8080/tfs and remove -all. The script still fails.

Ultimately I need a detail report that lists: source 'work item' 'change set'

For example:
xyz.cs 'work item 1' 'C397'
xyz.cs 'work item 2' 'C399'

Eventually I have to then work out that work item 1 is dependant on work item 2. I also have to track back to work item 1 to check the status.

Can someone assist with a 2010 version script? I have never written PS before.

I needed the exact same thing and I wrote a TFS utility for myself, using TFS API. It allows you to see all changes a work item triggered over time, and some things more. I've put it on codeplex. You can get it from:
tfshelper.codeplex.com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!