Do you use Global List in TFS?

Last updated by Tom Bui [SSW] 8 months ago.See history

Global List could be referenced in multiple work item types, if you are using the same list in different places and want to keep the drop down items consistent, global list is the best practice.

<FIELD
name="Discipline"
refname="Microsoft.VSTS.Common.Discipline"
type="String">
<font face="Verdana, sans-serif">&#160;&#160;</font><HELPTEXT>The discipline to which the task belongs</HELPTEXT>
  <ALLOWEDVALUES expanditems="true">
    <LISTITEM value="Development" />
    <LISTITEM value="Test" />
    <LISTITEM value="Project Management" />
    <LISTITEM value="Requirements" />
    <LISTITEM value="Architecture" />
    <LISTITEM value="Release Management" />
  </ALLOWEDVALUES>
</FIELD>

Figure: Bad example – Embed the list items in work item type definition

<?xml
version="1.0" encoding="utf-8"?>
<gl:GLOBALLISTS  xmlns:gl="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/globallists">
  <GLOBALLIST name="Disciplines">
    <LISTITEM value="Architecture" />
    <LISTITEM value="Requirements" />
    <LISTITEM value="Development" />
    <LISTITEM value="Release Management" />
    <LISTITEM value="Project Management" />
    <LISTITEM value="Test" />
  </GLOBALLIST>
</gl:GLOBALLISTS>
Figure: Good Example - Save above as
GlobalList.xml file 
<FIELD
name="Discipline"
refname="Microsoft.VSTS.Common.Discipline"
type="String">
  <HELPTEXT>The discipline to which the task belongs</HELPTEXT>
  <ALLOWEDVALUES>
    <GLOBALLIST name="Disciplines" />
  </ALLOWEDVALUES>
</FIELD>

Figure: Good example - Reference a global list in work item type definitionNote: Global list is defined at the Team Project Collection level and it needs to be uploaded before the process template could be uploaded

We open source. Powered by GitHub