{"id":56529,"date":"2013-02-15T07:53:50","date_gmt":"2013-02-15T15:53:50","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/devops\/?p=56529"},"modified":"2019-05-06T07:54:47","modified_gmt":"2019-05-06T15:54:47","slug":"multivaluelist-control-in-tfs-work-item-tracking","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/multivaluelist-control-in-tfs-work-item-tracking\/","title":{"rendered":"Multivaluelist control in TFS Work Item Tracking"},"content":{"rendered":"<p>One of the top asks from people in the field is to have the ability to have a dropdown in which you can select multiple values. Few people know that there is already a solution out on CodePlex, although it has its limitation. But it might be just good enough for what you are looking for.<\/p>\n<p>Since the data is stored in the format &ldquo;[value1];[value2]&rdquo;, and the data is backed by a field that stores only 255 characters, you can quickly run into a character limit when have long values in the dropdown and\/or select a lot of options. And because of this storage only limited query and reporting capabilities are available.<\/p>\n<p>To enable the solution, you need to follow these three steps:<\/p>\n<ol>\n<li>Update your work item type definitions using <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd695793.aspx\">witadmin<\/a> or the <a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f\">process template editor<\/a>.<\/li>\n<li>Install the control for TFS Web Access<\/li>\n<li>Install the control on all clients that run VS<\/li>\n<\/ol>\n<p>In the blog post I will add a field called OS to list the different platforms a bug applies to.<\/p>\n<h3>Update your work items<\/h3>\n<p>Export the work item type &ldquo;Bug&rdquo; with the command<\/p>\n<blockquote>\n<p>witadmin exportwitd \/collection:http:\/\/&lt;your server&gt;:8080\/tfs\/defaultcollection \/p:&lt;your team project&gt; \/n:Bug \/f:&lt;your path&gt;\\Bug.xml<\/p>\n<\/blockquote>\n<p>Open the exported Bug.xml file in notepad.<\/p>\n<p>Locate the &lt;FIELDS&gt; section and add the field OS:<\/p>\n<blockquote>\n<p>&lt;FIELD name=&#8221;Platform&#8221; refname=&#8221;Microsoft.OS&#8221; type=&#8221;String&#8221;&gt; <br \/>&nbsp; &lt;HELPTEXT&gt;Platform bug was found on&lt;\/HELPTEXT&gt; <br \/>&nbsp; &lt;SUGGESTEDVALUES expanditems=&#8221;true&#8221;&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Vista]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Win7]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Win8]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[All OS&rsquo;s]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[XP]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Win2K3]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Win2K8]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Win2K8 R2]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[WP8]&#8221; \/&gt; <br \/>&nbsp;&nbsp;&nbsp; &lt;LISTITEM value=&#8221;[Win8Svr]&#8221; \/&gt; <br \/>&nbsp; &lt;\/SUGGESTEDVALUES&gt; <br \/>&lt;\/FIELD&gt;<\/p>\n<\/blockquote>\n<p>In the FORM section locate the control where the new field should be placed beneath. In this example, I want to place the control below the Iteration Path, so I search for &lt;Control FieldName=&#8221;System.IterationPath&#8221;. Now paste the following text:<\/p>\n<blockquote>\n<p>&lt;Control FieldName=&#8221;Microsoft.OS&#8221; Type=&#8221;FieldControl&#8221; PreferredType=&#8221;MultiValueControl&#8221; Label=&#8221;OS&#8221; LabelPosition=&#8221;Left&#8221; \/&gt;<\/p>\n<\/blockquote>\n<p>It tells the system to use the MultiValueControl when it is available, but if a client does not have the control installed, it will fallback to the default FieldControl, which is the textbox.<\/p>\n<p>Save the file and upload it to your server with the command<\/p>\n<blockquote>\n<p>witadmin importwitd \/collection:http:\/\/&lt;your server&gt;:8080\/tfs\/defaultcollection \/p:&lt;your team project&gt; \/f:&lt;your path&gt;\\Bug.xml<\/p>\n<\/blockquote>\n<h3>Install control on Web Access<\/h3>\n<p>For the next step, you need to download the custom WIT controls from codeplex: <a title=\"http:\/\/witcustomcontrols.codeplex.com\" href=\"http:\/\/witcustomcontrols.codeplex.com\">http:\/\/witcustomcontrols.codeplex.com<\/a>. Extract the downloaded zip, which should contain two files.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/3666.image_05B80466.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/2161.image_thumb_138A4A61.png\" alt=\"image\" width=\"263\" height=\"57\" border=\"0\" \/><\/a><\/p>\n<p>Go to the Extentions page in Web Access, which you find with the url: &lt;a href=&quot;http:\/\/:8080\/tfs\/_admin\/_extensions&#8221;&gt;:8080\/tfs\/_admin\/_extensions&#8221;&gt;:8080\/tfs\/_admin\/_extensions&#8221;&gt;http:\/\/&lt;yourserver&gt;:8080\/tfs\/_admin\/_extensions<\/a> (or go to the Administration section, click on Control panel in the top navigation and choose the Extension hub).<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/2844.image_17949833.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/5076.image_thumb_3A5860A1.png\" alt=\"image\" width=\"922\" height=\"229\" border=\"0\" \/><\/a><\/p>\n<p>Click Install and locate the file WitCustomControls.MultiValueControl.zip.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/4571.image_6C50012B.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/0361.image_thumb_612676E1.png\" alt=\"image\" width=\"890\" height=\"318\" border=\"0\" \/><\/a><\/p>\n<p>And click Enable.<\/p>\n<p>Navigate to the Home page and create a new bug, and you will see the control:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/2677.image_6530C4B3.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/7457.image_thumb_5A073A69.png\" alt=\"image\" width=\"368\" height=\"308\" border=\"0\" \/><\/a><\/p>\n<h3>Install control for Visual Studio<\/h3>\n<p>If a user has not installed the control on his machine (s)he will get the default dropdown, because we have used the PreferredType attribute<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/5164.image_20F05D67.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/8306.image_thumb_67D98064.png\" alt=\"image\" width=\"194\" height=\"315\" border=\"0\" \/><\/a><\/p>\n<p>If you however run the msi that comes with the downloaded file from CodePlex, you will see the correct control in VS too.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/6874.image_19D120EF.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/0116.image_thumb_0EA796A5.png\" alt=\"image\" width=\"387\" height=\"279\" border=\"0\" \/><\/a><\/p>\n<p>When you have selected multiple options with the dropdown, users that have not installed the control are still able to modify the data<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/5807.image_409F372F.png\"><img decoding=\"async\" style=\"border-width: 0px\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/45\/92\/metablogapi\/6283.image_thumb_07885A2D.png\" alt=\"image\" width=\"184\" height=\"304\" border=\"0\" \/><\/a><\/p>\n<h3>Final words<\/h3>\n<p>Although it has its limitations, it might be just good enough for you. If you are using our service (<a href=\"http:\/\/tfs.visualstudio.com\">http:\/\/tfs.visualstudio.com<\/a>) or don&rsquo;t want to deal with the customization or the limitations, a good alternative good be to use the Tags that we have announced: <a title=\"http:\/\/blogs.msdn.com\/b\/bharry\/archive\/2013\/01\/30\/announcing-visual-studio-2012-update-2-vs2012-2.aspx\" href=\"http:\/\/blogs.msdn.com\/b\/bharry\/archive\/2013\/01\/30\/announcing-visual-studio-2012-update-2-vs2012-2.aspx\">http:\/\/blogs.msdn.com\/b\/bharry\/archive\/2013\/01\/30\/announcing-visual-studio-2012-update-2-vs2012-2.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the top asks from people in the field is to have the ability to have a dropdown in which you can select multiple values. Few people know that there is already a solution out on CodePlex, although it has its limitation. But it might be just good enough for what you are looking [&hellip;]<\/p>\n","protected":false},"author":241,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-56529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"acf":[],"blog_post_summary":"<p>One of the top asks from people in the field is to have the ability to have a dropdown in which you can select multiple values. Few people know that there is already a solution out on CodePlex, although it has its limitation. But it might be just good enough for what you are looking [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/56529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/241"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=56529"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/56529\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=56529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=56529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=56529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}