Monday, May 13, 2013

Team Foundation Server 2012: Work item link type end '' does not exist

After upgrading a customers TFS environment to Team Foundation Server 2012(Update 2), some minor issues were found. One of the more interesting issues was the following one:

When opening the Team Foundation Server Web Access, a specific work item query always failed with the following JavaScript error:

Work item link type end '' does not exist.TFS.WorkItemTracking.LinkTypeEndDoesNotExistException: Work item link type end '' does not exist.
   at findLinkTypeEnd (
   at getColumnValue (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.WorkItemTracking.Controls.Query.min.js?__loc=en-US:4:30154)
   at getColumnText (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:12128)
   at _drawCell (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:10896)
   at _updateRow (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:10331)
   at _updateRow (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.WorkItemTracking.Controls.Query.min.js?__loc=en-US:4:40857)
   at _drawRows (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:8529)
   at _updateViewport (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:30553)
   at _redraw (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:32717)
   at redraw (http://servername:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.UI.Controls.Grids.min.js?__loc=en-US:4:11986)

After this happens, everything else on the webpage starts to fail too and the only way to solve this is by doing a full page refresh.

The strange thing was that when opening the same work item query using Team Explorer, it just worked. This set me in the wrong direction because it made me think that the issue was related to the web access and not to the work item query itself.

But in the end I found it, the work item query was using the LinkType column which is not available in TFS 2012. To remove this column, execute the following steps:

  • Open the work item query
  • Go to Column Options
  • Select the column you want to remove from the Selected Columns list and click on the ‘<’ button to remove it.
  • Click OK to apply the changes


Anonymous said...

Wow! this bug still exists in TFS 2015, you saved by day.

Xagyg said...

The easiest way to reproduce this is to create a query that uses linked work items (type: Work Items and Direct Links), make the Link Type a visible column (which is automatic, i believe) and then change the query so it's a flat list.

AT this point, you're still trying to display the Link Type, which isn't defined for a flat list, so you start getting this problem. If you switch out of the web environment, and back into VS, you probably haven't saved the change yet, so the VS version is still the tree type version of the query.

At least, that's what happened to me, but i wouldn't have figured it out due to the lack of syntax and punctuation in the error message, without this post! Thanks!