14
votes

In Visual Studio (2012+) I want a clickable reference from a code comment to a TFS work item. Is there a simple way to do this, and is this also possible from comments within the body of a function (not being the summary of the function)?

So I want something like this:

/// <summary>
/// Example of a summary
/// </summary>
static void Main()
{
    int dummy = 1; //Should be 1 according to @Task1234 <- should be a hyperlink
}

And rather not something like this:

/// <summary>
/// Example of a summary, see <a href="http://mytfsserver:8080//tfs/myCollection/Branch/_workItems#id=1234"> Task 1234 </a>.
/// </summary>
static void Main()
{
}

Some tag reading material: Recommended Tags for Documentation Comments (C# Programming Guide)

1
isn't this already implied through TFS changesets? anotating a file will show the changeset that altered the file and if you associate work items with your check in you can identify the work item that triggered the change. I don't think you could get a clickable link from inside code.Just TFS
Ofcourse you can backtrace the workitem, but sometimes a direct link is very handy. It's not that I am lazy, but I rather code than track and trace ;).Michel van Engelen
+1 I would like the same feature in comments added to the history (discussion), and also check-in comments. Maybe it already exists, but I have tried @123, #123 and [123] among others, but all brute force attempts failed :-(Louis Somers

1 Answers

8
votes

No, that isn't possible - not without writing an addin that pre-parses the page looking for likely links.

I know there was an addin like this for FogBugz (and other bug/workitem tracking systems), but I've not seen one specifically for TFS (although that doesn't mean one doesn't exist).