In Visual Studio, click File, and then New File.
In the Categories pane, click General.
In the Templates pane, click XML File, and then click Open.
To this new file, add the following XML shown in bold text. This defines a global list of disciplines relevant to your organization.
<?xml version="1.0" encoding="utf-8"?>
<gl:GLOBALLISTS xmlns:gl="http://schemas.microsoft.com/VisualStudio/2008/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>
On the toolbar, click Save to save changes to the XML file.
The Save File As dialog box is displayed.
Select the location where you want to save the file, type disciplines.xml in the File name field, and then click Save.
Import this global list onto the Team Foundation Server by typing the following command and then pressing ENTER:
glimport /f "File Path\disciplines.xml" /t "Team Foundation Server name"
Note: |
|---|
Because a global list has global effect on the
Team Foundation Server, you do not specify a team project when you run the glimport command.
|
Display the global lists on the Team Foundation Server by typing the following at the command prompt and then pressing ENTER:
glexport /t "Team Foundation Server name"
Notice that the newly added list is displayed.
In Visual Studio, open the file that contains the Special Task work item type definition. To do this, click the tab labeled specialtask.xml.
Find the following section of the XML file that defines the Discipline field.
<FIELD name="Discipline" refname="Microsoft.VSTS.Common.Discipline" type="String" reportable="dimension">
<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>
Delete the list of allowed values by removing the following XML shown in bold text.
<FIELD name="Discipline" refname="Microsoft.VSTS.Common.Discipline" type="String">
<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>
Set the allowed values of the Discipline field to the global list that you defined previously, by adding the following XML to the 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>
On the toolbar, click Save to save changes to the XML file.
Import the changed Special Task work item type into the Team Foundation Server. To do this, at a Visual Studio command prompt, type the following and then press ENTER:
witimport /f "File Path\specialtask.xml" /t "Team Foundation Server name" /p WITLab
This imports the specialtask work item type into the Team Foundation Server. The following is displayed when the import operation finishes:
Work item type import complete.
In the Team Explorer window in Visual Studio, click Refresh to download the latest updates from the server.
These updates include the changes that you just imported. Wait several seconds until all the nodes are loaded. Nodes that are still loading are labeled "working."
Create a new Special Task work item. To do this, right-click the Work Items node, point to Add Work Item, and then click Special Task.
This work item is created from the work item type that you changed and imported.
Select the Discipline box on the new work item form.
Note that the allowed values are now populated from the global "Disciplines" list.
Click Close to close the new Special Task. Click No when you are prompted to save the work item.
Add values to the Discipline field without editing and re-importing the work item type definition file specialtask.xml. To do this, first click the disciplines.xml tab in Visual Studio to add the following new values, shown in bold text.
<GLOBALLIST name="Disciplines">
<LISTITEM value="Architecture" />
<LISTITEM value="Requirements" />
<LISTITEM value="Development" />
<LISTITEM value="Release Management" />
<LISTITEM value="Project Management" />
<LISTITEM value="Test" />
<LISTITEM value="Marketing and Sales" />
<LISTITEM value="General Management" />
<LISTITEM value="Other" />
</GLOBALLIST>
On the toolbar, click Save to save changes to the XML file.
Import this global list onto the Team Foundation Server by typing the following at the command prompt and then pressing ENTER.
glimport /f "File Path\disciplines.xml" /t "Team Foundation Server name"
In the Team Explorer window in Visual Studio, click Refresh to download the latest updates from the server.
These updates include the changes that you just imported. Wait several seconds until all the nodes are loaded. Nodes that are still loading are labeled "working."
Create a new Special Task work item. To do this, right-click the Work Items node, point to Add Work Item, and then click Special Task.
This work item is created from the work item type that you changed and imported.
Select the Discipline box.
Notice that the new values in the global list now appear as choices in the box.
Note: |
|---|
You can reference global lists for allowed values that are shared between several work item types or across team projects. This enables a single update to the global list to automatically update the allowed values of all work item types that refer to the list.
|
Click Close to close the new Special Task. Click No when you are prompted to save the work item.