This is the uRl that I used to access work items,
=> http://ServerName:PortNumber/tfs/web/wi.aspx?id=xxidxx
Edit The format I specified works with TFS 2010. It basically generates the path to the work item in the web view. Clicking on it opens a work item in a web view.
Alternatively, you can also get the navigation URL programmatically.
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("TFSURL")); var versionControl = tfs.GetService<ICommonStructureService>(); var projects = versionControl.ListAllProjects(); var myService = tfs.GetService<TswaClientHyperlinkService>(); var myUrl = myService.GetChangesetDetailsUrl(21);
Thus, the TswaClientHyperlinkService service is a Microsoft hyperlink service. This will create url formats for the absolute path, relative path, path and query, blah blah.
Hth,
Cheers, Tarun
PS I hate making mistakes !!! hahaha ...

EDIT And since you have a URI in your case and you are already using the TFS API, these two lines of code will do the trick.
var testManagementService = tfs.GetService<ILinking>(); var testControllers = testManagementService.GetArtifactUrl(@"vstfs:///VersionControl/Changeset/205151");
This will create https://ServerName:PortNumber/defaultcollection/VersionControl/Changeset.aspx?artifactMoniker=205151
NTN
Cheers, Tarun
source share