I had a question from a customer who needed to have a default list of links displayed on their Work Item in TFS. While one would think the LinksControl would be the ideal place, there isn’t a good way to insert links to it without resorting to writing custom code. Fortunately there is an easier way – the HtmlControl.
To use it, open your work item type in the Process Editor and add a new field called “Default Links” or whatever you want to name it. The type should be HTML (I also chose not to make it reportable):
Now click the Rules tab and add a new DEFAULT rule. Choose “value” in the From drop-down, and paste the HTML that will make your list of links. Here I used:
You also probably want to add a FROZEN or READONLY rule since it’s unlikely you’ll want this to change.
Once you’ve saved that field, click over to the Layout tab in the Work Item Editor. Find the place where you want the links to go and add a new control. Here I’ve created a new Group in the bug form for the links and am adding it there:
Pick the field we just added and label it whatever you’d like. Mark the field as ReadOnly, and then change the Type to HtmlFieldControl. This will render our HTML.
Save the work item type and reimport it to the server. If you have your team project open, right-click and refresh it, and then try creating a new work item of that type or opening an existing one: