Can you create a Runtime Query in TFS? - tfs

Is there any way to create a query in TFS that prompts you for query parameters at runtime?
E.G. A query named "[TeamMember] Undone Tasks" where TFS prompts you for the team memeber at runtime?

Sorry - this is not possible at the moment in TFS 2008 and I haven't seen that feature in any of the TFS 2010 beta's either. I have seen it asked for before though so I'm sure the team know that it would be a nice thing to have.
You could use the API, a query in Excel or hook Excel into the datawarehouse to give you that type of data if you wanted it.

Related

TFS - Find In Files

My team has just migrated from VSS to TFS 2013. On VSS, we would often search the entire database for the occurrence of some string (usually a table or procedure name) to find out everywhere it is used. This functionality is clearly not available in TFS.
I have seen some alternatives, none of which sound very viable in our environment. As a result, I started tinkering with creating an app (or extension) to do it directly from TFS. However, the only way I found to do it is to download and search each file one at a time (I also could not find a way to filter the return from GetItems with a list of file extensions), which is slow and undesired.
Is there a faster way, through the API, to search through the source files in a TFS server?
Microsoft has announced that they are working on this exact feature, and it should be coming to Visual Studio Online in Q1 2015, and to on-premise TFS sometime after that.
You can read about it at the bottom of this blog post:
http://blogs.msdn.com/b/bharry/archive/2014/11/12/news-from-connect.aspx
Also the estimated timeline is publicized here:
http://www.visualstudio.com/en-us/news/release-archive-vso.aspx
You can use TFS Administrators Toolkit, here is the description of search feature:
http://mskold.blogspot.se/2012/09/find-in-files-new-feature-of-tfs.html

Search Work Items Query

After using the 'Search Work Items' plugin for TFS 2010, I am struggling with the seeming limitations of the similar tool in TFS 2012.
My teams use this ad-hoc query to quickly search across all team projects to find work items based on a number of fields. I have been unable to find a way to modify the query to search additional fields and remove the #Project limitation. In TFS 2010 using the "--Template" string to open and modify the query was the ticket. Is there a similar solution in TFS 2012?
It is possible to manually specify all the extra fields every time using the search syntax (painful) - but how to remove limitations such as #Project etc?
You should just be able to open a query in Team Explorer and remove the #project designation. You however will not be able to remove the #project limitation from the search box now on the TFS 2012 Web Access UI as it will only search across a single Team Project.
I would recommend that you read:
http://blog.hinshelwood.com/project-of-projects-with-team-foundation-server-2010/
http://blog.hinshelwood.com/one-team-project/
I think as you go forward you will find more and more that you are running into the Team Project boundary.

How can I query a folder in TFS to show me the latest ChangeSet for each object?

Currently, our DBAs require the TFS changeset number for any scripts/stored procedures/functions that need to get deployed. I have a folder in our TFS project with all of my stored procedures in it, and I'd like to run a single query that will list each object in that folder and the latest changeset. I'm using VS2010 Team Explorer with TFS Server 2008 (I believe), and would be happy to script it in PowerShell or some other tool, but don't know where to begin. Can someone provide me some direction?
TFS has a lot of extensibility points that make running a query like this possible. If it were me, I'd simply use the tf.exe command-line client. For example:
tf properties $/Path/To/Folder -recursive
This will show you the latest changeset for each of the files beneath the given folder (as well as other information.)
While the output from the command-line client is well-formed and easily parseable, you may still prefer a more programmatic way to do it. You can use the very powerful .NET API in order to query from the server. You'll want to call the VersionControlServer.GetItems method. For example:
ItemSet items = vcs.GetItems(#"$/Path/To/Folder", RecursionType.Full);
If you haven't yet, you should take a look at the TFS 2008 Power Tools, which include the TFS Power Shell Extensions. My powershell-fu is weak, but I think that the above in Power Shell works out to be something like:
$tfs = get-tfs http://yourserver:8080/tfs/YourCollection
$tfs.VCS.GetItems('$/Path/To/Folder', $tfs.RecursionType::Full)

What should I use for syncing TFS 2008 Work Items with an external database?

What should I use for syncing TFS 2008 Work Items with an external database? I just want basic functionality such as creating and updating work items in TFS so that they match our QA department's bug tracking software.
You can consider to use the Integration platform of TFS: http://tfsintegration.codeplex.com/
If you need to do it in an automated fashion, it is straightforward to do it with the API. Just modify your work item template to have an external reference for the bug-tracking system's key. That way you can keep things straight.

How to export from Mingle to TFS 2010 (Scrum for Team System)

We've currently got all our User Stories and Tasks in Thoughtworks Mingle, but what to move them into TFS 2010 which we're be using with Scrum For Team System.
Has anyone had any experience doing this? If so, how did you go about doing it? Were there any gotchas along the way?
Thanks,
John
I'm not familiar with Mingle, so I'm not sure what kind of access you have to the data. I can envision two scenarios:
*1. API Access to Mingle data
If this is the case, it's going to be very simple to create the new work items programmatically. We do this today between our help-desk system and TFS. It's just a matter of creating a work item, setting the fields, and calling "Save()".
*2. Export access to Mingle data
This is probably an easier solution. Export to Excel (via CSV or custom conversion), and create a TFS list in Excel using the plug-in. Reorder your columns as necessary in the exported data, and copy and paste from the exported data to the TFS data. Click on "Publish" and you're done.
Between the two, I'd recommend the API approach if this is going to be ongoing. If it's going to be a one-time thing, the Excel approach works fine.

Resources