We have a system in use where developers will log a support ticket using a new 'Support Ticket' work item in TFS 2010. If there's a code change as a result they will link the changeset to this work item type. Alternatively if there's a related Bug in the system that requires a code change they will link the Support ticket to the bug and then check in the changeset linked to the bug.
I'm trying to pull out a report either in TFS or preferably using SQL that gives me:
- the number of support tickets created in a month.
- the number of support tickets with linked bugs that have a changeset logged against them
- the number of support tickets with a change set directly linked to the support ticket.
Is there a way to do this in SQL
Run this against your Data Warehouse. This SQL will list all Work Items with their associated Change Sets. I've commented out a few items in the WHERE clause and left them in to give you an idea on what you can filter on as I'm not sure what process template you have setup in TFS.
The df.FilePath field commented out in the WHERE clause allows you to filter on specific repositories/branches.
This code was run against TFS 2013, but I believe the Schema is the same in 2010
You can write queries against the TFS data warehouse or the TFS analysis cube, assuming you have reporting configured. Do not write queries directly against the project collection databases.
The data in the warehouse should contain what you're after. For example, there is a Fact table for linked items:
And for work item history:
It may require some tricky queries, but the data should be there.