Search code examples
xmltfs-2015

FIELD from my TFS Bug.xml is not hidden as expected


I have a Field in my TFS Bug.xml as displayed below

  <FIELD name="Root Cause" refname="core.resolution" type="String">
    <ALLOWEDVALUES expanditems="true">
       <LISTITEM value="Code" />
       <LISTITEM value="Working as Designed" />
       <LISTITEM value="Documentation" />
       <LISTITEM value="SPaG" />
       <LISTITEM value="User Interface" />
       <LISTITEM value="Database" />
       <LISTITEM value="Test Data" />
       <LISTITEM value="Duplicate" />
       <LISTITEM value="Cannot Reproduce" />
       <LISTITEM value="UX" />
       <LISTITEM value="Environment" />
       <LISTITEM value="Integration" />
    </ALLOWEDVALUES>
    <WHENNOT field="System.State" value="Done">
      <READONLY />
    </WHENNOT>
  </FIELD>

However, my intention is that when the State: field is done, only then should my Root cause field be visible, how can I modify my XML to achieve this?

          <Column PercentWidth="33">
        <Group Label="Details">
          <Column PercentWidth="100">
            <Control FieldName="Microsoft.VSTS.Common.Severity" Type="FieldControl" Label="Priority" LabelPosition="Left" />
            <Control FieldName="System.CreatedDate" Type="FieldControl" Label="Created Date" LabelPosition="Left" />
            <Control FieldName="System.CreatedBy" Type="FieldControl" Label="Created By" LabelPosition="Left" />
            <Control FieldName="core.resolution" Type="FieldControl" Label="Root Cause" LabelPosition="Left" /> 

Solution

  • I found a better solution that to use EMPTY rule. You could change the xml like this below:

    <FIELD name="Root Cause" refname="core.resolution" type="String">
        <ALLOWEDVALUES expanditems="true">
           <LISTITEM value="Code" />     
        ......
        </ALLOWEDVALUES>
        <WHENNOT field="System.State" value="Done">
          <EMPTY />
        </WHENNOT>
      </FIELD>