Reputation: 63709
We have 4 Team Project Collections with a dozen-or-so Team Projects each. We've started using the integrated Code Review system, and request reviews across those Collections and Projects.
Is there an easy way to find all Code Reviews you're involved in, across Collections or at least across Projects in a Collection? I'd prefer a way to do it in the Team Explorer inside Visual Studio, but have access to the web portal as well. I'd already be happy if I could search within a Collection, if it's not possible to do it across them.
I've carefully review the "My Work" section of the Team Explorer, and also closed the sln
to try to force the context of the Explorer to the entire Collection. No dice: the "My Work" header still shows the actual Project in a dropdown.
I've tried to create a custom "Query", but am not sure how to proceed. The query that is generated has a clause to filter on Team Project = @Project
, but I deleted that leaving me with basically this query:
Work Item Type = Code Review Request
I've left out State <> Closed
for testing purposes, and I'd create a seperate query (I think) for work item type Code Review Response
, but before I go there: the above query seems to give only reviews for the currently selected Team Project. Additionally, upon saving it, I get presented with a dialog that wants me to save the query inside a specific Project, further suggesting that it's still project-specific.
I'm using TFS 2013 but we tend to upgrade whenever it's useful so if there's upcoming features in newer version that solve this I'd be happy to hear about them.
Bottom line: how to get an overview of all your Code Reviews on your TFS server?
Upvotes: 8
Views: 17835
Reputation: 447
On VS 2015, Go to Team Explorer Home > Click on Work Items ... > Select New Query > Select "Reviewed By" in the Field column and add the related username in the Value field and run the query. You will see all the Code reviews you have been a part.
Upvotes: 6
Reputation: 1446
Can you please double check that your query does not return any code reviews from other Team Projects by clicking "Column Options" on the Results sections and add "Team Project" field? [And verifying that you have a Code Review Request on another Team Project].[Don't worry if the Filter has an option for the Team Project selected for your Team Project on the Column Options window].
You can also test this by adding another value for the "Team Project" clause.
Upvotes: 0
Reputation: 2435
Sadly I don't think there is a nice way to do what you are asking. Certainly not within Team Explorer. Code Reviews as you are aware get stored as work items and there is a strong boundary between Team Projects, which among other things, work items cannot cross. A note for the future, depending on how your business operates, you could consider 1 Team Project Collection, 1 Team Project and segregate your work by Teams and Areas. http://nakedalm.com/one-team-project/ this doesn't help you now of course.
I'm pretty sure that you will not be able to create a query using TFS to return the items you want (note, if you could, you would need to query for Work Item Response that are assigned to you Assigned To = @Me and not the Work Item Request. The request is the person making the code review request and the response is the reviewer(s).
Do you have tfs reports enabled? If so, as ds19 suggests, you could query the tfs_Warehouse db directly.
Another solution might be the TFS API but you will need TFS 2015 for that (which is packed full of features by the way) (Even though the link says it's for Visual Studio Online, it works for On-Prem too.)
I know this doesn't answer your question but hopefully it gives you some things to think about
Upvotes: 2
Reputation: 3165
You can query the Tfs_Warehouse database:
SELECT count(*), dwi.[TeamProjectCollectionSK]
FROM [Tfs_Warehouse].[dbo].[DimWorkItem] dwi
where dwi.System_WorkItemType = 'Code Review Request'
group by dwi.[TeamProjectCollectionSK]
Upvotes: 0