{"id":16236,"date":"2016-05-14T06:38:29","date_gmt":"2016-05-13T23:38:29","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/?p=16236"},"modified":"2019-02-14T17:34:02","modified_gmt":"2019-02-15T01:34:02","slug":"boolean-checkbox-fields-on-team-services","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/boolean-checkbox-fields-on-team-services\/","title":{"rendered":"Boolean (checkbox) fields on Team Services"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox1.png\"><img decoding=\"async\" class=\"  alignnone wp-image-16245 size-full\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox1.png\" alt=\"checkbox1\" width=\"773\" height=\"112\" \/><\/a><\/p>\n<p>The wait is over. With the latest deployment to Team Services, you can now add a checkbox to your work items. To do this, simply <a href=\"https:\/\/msdn.microsoft.com\/library\/vs\/alm\/work\/process\/customize-process-field#AddacustomfieldAddacheckboxfield\">add a Boolean field<\/a> to your work item type.<\/p>\n<p>It\u2019s been a long journey and I\u2019m sure more than one of you is wondering why it\u2019s taken us so long. The simple truth is we just haven\u2019t made it a priority when weighed against the other features we\u2019ve shipped over the years.<\/p>\n<p>There were, however, some technical challenges with no great\u00a0solutions. One of the key challenges in designing the checkbox was how to handle the tri-state nature of a Boolean field where the field could be True, False, or NULL (unset). We decided to work around this problem by treating NULL and False values the same both in the work item and query experiences. In addition to this, we have a variety\u00a0of clients we need to make sure work with the new field type from web to Visual Studio to Excel.<\/p>\n<p>In this post, I\u2019ll go into more detail on the special characteristics and behavior of the Boolean field.<\/p>\n<h3>Field definition<\/h3>\n<p>The first thing you\u2019ll notice when adding a Boolean field is the sparseness of the Options tab. Boolean fields are always required to have a value of either True or False, and the default value for Boolean fields is always False.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox2.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-16255\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox2.png\" alt=\"checkbox2\" width=\"667\" height=\"265\" \/><\/a><\/p>\n<h3>Client support<\/h3>\n<p>Your Boolean field will show as a checkbox control in the web view of the work item, a text box in Visual Studio Team Explorer, and a 0 or 1 in Excel.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox3.png\"><img decoding=\"async\" class=\"alignnone  wp-image-16265\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox3.png\" alt=\"checkbox3\" width=\"853\" height=\"480\" \/><\/a><\/p>\n<p>In the web view and Eclipse Team Explorer Everywhere (TEE), check the box to set the value to True and uncheck the box to make the value False.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox4.png\"><img decoding=\"async\" class=\"alignnone  wp-image-16275\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox4.png\" alt=\"checkbox4\" width=\"791\" height=\"419\" \/><\/a><\/p>\n<p>To set the value for the field in Visual Studio Team Explorer, you must type either \u201cTrue\u201d or \u201cFalse\u201d into the text box. This will improve in VS 2015 Update 3 where these Boolean fields will have a dropdown with \u201cTrue\u201d and \u201cFalse\u201d values. In VS vNext, we\u2019ll have a checkbox control.<\/p>\n<p><img decoding=\"async\" class=\"alignnone  wp-image-16305\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox5.png\" alt=\"checkbox5\" width=\"831\" height=\"77\" \/><\/p>\n<p>Excel will only accept 0 (False) or 1 (True) as inputs, and there is a dropdown with those values.<\/p>\n<p>The table below summarizes the experience for Boolean fields for various clients:<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"312\"><strong>Client<\/strong><\/td>\n<td width=\"312\"><strong>Experience<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Web access<\/td>\n<td width=\"312\">Checkbox control<\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Eclipse (TEE)<\/td>\n<td width=\"312\">Checkbox control<\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Visual Studio vNext<\/td>\n<td width=\"312\">Checkbox control<\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Visual Studio 2015 Update 3<\/td>\n<td width=\"312\">Dropdown with True and False values<\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Other Visual Studio versions<\/td>\n<td width=\"312\">Text box that accepts True of False input<\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Excel<\/td>\n<td width=\"312\">Dropdown with 0 and 1 values<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>New Boolean fields and existing work items<\/h3>\n<p>As alluded to earlier, work items with a Boolean field must have a True or False value for that field. So what happens with work items that already exist when you add a new Boolean field? Existing work items will not be updated with a new revision to set the field value.\u00a0 However, when querying on the Boolean field, these work items will be treated as if they have a False value for the field. Therefore, if you query for False values, you may see some work items have a \u201cFalse\u201d value and some work items have an empty value.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox6.png\"><img decoding=\"async\" class=\"alignnone  wp-image-16315\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox6.png\" alt=\"checkbox6\" width=\"783\" height=\"443\" \/><\/a><\/p>\n<p>The work items with an empty value must have 1) existed before the field was added <em>and<\/em> 2) have not been updated since the field was added. On any update to work items 11 or 12 in the example above, the \u201cReady for deployment\u201d field will be set either to False (default) or True (if the user sets the field to True).<\/p>\n<p>We believe this is the right compromise between not updating all work items when adding a field while still preserving the expected querying experience. With this approach, searching for work items with the values True OR False will always return all your work items as demonstrated below.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox8.png\"><img decoding=\"async\" class=\"alignnone  wp-image-16295\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox8.png\" alt=\"checkbox8\" width=\"736\" height=\"453\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/checkbox7.png\"><img decoding=\"async\" class=\"alignnone  wp-image-16325\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/05\/checkbox7.png\" alt=\"checkbox7\" width=\"736\" height=\"460\" \/><\/a><\/p>\n<h3>Closing<\/h3>\n<p>This post covers special behavior around Boolean fields that I believe is important to document. However, our goal is to bring a checkbox experience to VSTS that is intuitive to use and simple to understand. As you use the new field type, please comment or <a href=\"mailto:derfu@microsoft.com\">email<\/a> with any feedback you have on the Boolean field experience.<\/p>\n<p>Derrick Fu\nProgram Manager, VSTS<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The wait is over. With the latest deployment to Team Services, you can now add a checkbox to your work items. To do this, simply add a Boolean field to your work item type. It\u2019s been a long journey and I\u2019m sure more than one of you is wondering why it\u2019s taken us so long. [&hellip;]<\/p>\n","protected":false},"author":206,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[227,1],"tags":[],"class_list":["post-16236","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agile","category-devops"],"acf":[],"blog_post_summary":"<p>The wait is over. With the latest deployment to Team Services, you can now add a checkbox to your work items. To do this, simply add a Boolean field to your work item type. It\u2019s been a long journey and I\u2019m sure more than one of you is wondering why it\u2019s taken us so long. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/16236","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\/206"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=16236"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/16236\/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=16236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=16236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=16236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}