Yes it’s possible to have different layouts for the same Work Item Types for the Web Access and Visual Studio / Test Manager. See link for details.
Start TestRun directly with Microsoft Test Manager Shortcut
I wrote about MTM.exe’s (Microsoft Test Manager of Visual Studio Test Professional) more or less secret shortcuts a and URI handlers a while ago but as of 2013 (at least I noticed it with 2013.1 and up) there are now also URI protocols that allow one to directly start mtm.exe in its test run mode via mtrs:// ..uris, e.g.:
.. which will start mtm.exe and connect to the ‘someserver.local’ server at por 8090, using its ‘DefaultCollection’ TeamProjectCollection, the ‘project_name’ project inside of that one and then chooses the test point with id ‘9960’ in the test plan with id ‘23’.
Beware of the TFS PickWorkItemsControl
While finishing a new functionality for a TFS-based application that utilizes Microsoft’s PickWorkItemsControl it became apparent that it does not behave as expected and does not return the actually selected WorkItems inside that control in all circumstances.
Particularly once the WorkItems are loaded inside that control and selection occurs in combination with applied sorting the WorkItems returned from the .SelectedWorkItems() method returns the WorkItem instances that are visually at the place the previously selected ones were placed at.. as if the visual index is out of sync with the underlying datasource-related index.
What this means is that the returned WorkItems are not (necessarily) the ones the user chose, including the same work item being returned multiple times instead of other selected ones.
This happens in the VS2010 version of the control but it seems like this behaviour remained unchanged / unfixed up until TFS/VS2013 Update 1.
So if you utilize this built-in functionality in your applications you might want to evaluate whether and how this affects you.
The bug has been confirmed but already been closed with WONTFIX. Oh well. Custom dialog it is then..
It never hurts to re-evaluate your applications’ performance every now and then and in case of TFS and its Client Object Model / API you do have one built-in functionality that’s not immediately apparent: Server Calls tracing.
Follow the link to see how to enable this and you’ll get a deeper understanding what’s going in. Really helpful.
Refreshing VisualStudio Work Item ToolWindows programmatically
I recently ran into a situation where I wanted to trigger a refresh and reload of all instances of a particular TFS Work Item programmatically if the user had it open either directly or in a query.
This proved to be non-obvious at first and unfortunately the official MS folks over at the MSDN forums couldn’t really help so I dived a little deeper into the Visual Studio SDK and did in fact find a solution.
Secondly, that documentService instance has a method called .GetDocuments() which gets all currently open VisualStudio WorkItem related Documents (=Windows), more particularly instances implementing the IWorkItemTrackingDocument interface.
Thirdly, as the MSDN documentation lacks an overview of classes implementing that interface I had to dig around a little and luckily came across an old, but still valid entry on the MSDN blogs detailing the three document types, namely:
IWorkItemDocument (= the open toolwindows that display a WorkItem) is the easiest one to use at it contains an .Item property which actually is the WorkItem it is displaying, so you can simply go ahead and check whether the particular instance is the one you want to refresh (e.g. by comparing its .Id property) and if so, call the .SyncToLatest() method and you’re done.
Similiarly you can use the IResultsDocument which is basically the split query results view containing a grid with the query results in the one half, and the selected workitem in the other half (a so-called TriageDocument). However, to access the WorkItems the query returned as a result you can either use the (obsolete) .WorkItems property (that was easy) or the now-favored ResultListDataProvider which provides paginated access to the WorkItems. Either way, identify the WorkItem(s) you want to refresh out of these and again, refresh and sync them to their latest state.
And that’s it.