Search code examples
azure-devopstfs-workitemworkitem

Don't know how to set a Boolean workitem field in Azure DevOps Server to display Yes/No instead of True/False


I'm running Azure DevOps Server 2019 and I added a Boolean field to my User Story work item. The description for Boolean fields says "Boolean: Adds a True/False or Yes/No field.". It defaults to displaying a True/False toggle. I can't find how to change it to display a Yes/No toggle instead.


Solution

  • Sorry for confusion. The value "Yes/No" is actually not supported for a Boolean field type by default. An a workaround, you can use String type instead of Boolean type, which render a dropdown box for Yes/No:

    <FieldDefinition name="MyField" refname="My.Field" type="String">
      <ALLOWEDVALUES expanditems="true">
        <LISTITEM value="Yes" />
        <LISTITEM value="No" />
      </ALLOWEDVALUES>
    </FieldDefinition>