Hi, lately I had been doing work item customization on work item types that exist within multiple team projects (in my case the bug work item).
The work item is still using the Integration Build field (you may also be using the Found In (Microsoft.VSTS.Build.FoundIn) field) which team build updates upon each successful build.
When you use Team Build the first time within a team project, TFS automatically adds a global list to the Integration Field field in a format “Build - <team project name>”
For example;
<FIELD reportable="dimension" type="String" name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild">
<HELPTEXT>The build in which the bug was fixed</HELPTEXT>
<SUGGESTEDVALUES>
<LISTITEM value="None" />
</SUGGESTEDVALUES>
<SUGGESTEDVALUES filteritems="excludegroups">
<GLOBALLIST name="Builds - TeamProjectName" />
</SUGGESTEDVALUES>
</FIELD>
So if you have 5 team projects you will have 5 different work item definitions, each having a different global list name.
So if I wanted to change the bug work item by adding a new field and introduce the field for all my team projects (all teams use the same process) I had to change the global list name manually before each work item definition import into my production environment. This is a tedious and very error prone process.
A solution is to use the WHEN condition it is possible to invoke different global lists based on the name of the team project. This allows you to keep one process template definition instead of manually modifying each work item type definition for each team project manually.
<FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
<HELPTEXT>The build in which the task was completed</HELPTEXT>
<SUGGESTEDVALUES expanditems="true">
<LISTITEM value="None" />
</SUGGESTEDVALUES>
<WHEN field="System.TeamProject" value=" TeamProjectNameA" >
<SUGGESTEDVALUES expanditems="true" filteritems="excludegroups">
<GLOBALLIST name="Builds - TeamProjectNameA " />
</SUGGESTEDVALUES>
</WHEN>
<WHEN field="System.TeamProject" value=" TeamProjectNameB" >
<SUGGESTEDVALUES expanditems="true" filteritems="excludegroups">
<GLOBALLIST name="Builds - TeamProjectNameB" />
</SUGGESTEDVALUES>
</WHEN>
<WHEN field="System.TeamProject" value=" InCycle Addons" >
<SUGGESTEDVALUES expanditems="true" filteritems="excludegroups">
<GLOBALLIST name="Builds – InCycle Addons" />
</SUGGESTEDVALUES>
</WHEN>
</FIELD>
Obviously the shortcoming of this solution is that you need to add new team project within the definition you customize when new ones are created.
Hopefully in future versions of TFS an easier implementation could be allowed. Maybe a key could be use such a <GLOBALLIST name="Builds – [Project]" /> similar to implement done for group security ([Project]\Contributors).
Bertrand.