title: De-mystifying allowed values for a field in Azure DevOps based on values of another field or Rules?
body: <p>When you create a work item such as Bug in Azure devops, the values that you would see in the drop down of say Reason field would depend on the value you select for State field. For e.g. see these screenshots (Template Agile, no customizations)</p>
  
  <p><a href="https://i.stack.imgur.com/umTio.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/umTio.png" alt="allowed values based on State Field"></a></p>
  
  <p>Then if you change the state, the allowed values change as shown</p>
  
  <p><a href="https://i.stack.imgur.com/4y4rc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4y4rc.png" alt="enter image description here"></a></p>
  
  <p>To make matters more confusing, these are just few of the values that are returned by the documented REST API </p>
  
  <p>The given API returns</p>
  
  <pre><code> "defaultValue": null,
          "allowedValues": [
            "Verified",
            "Not fixed",
            "Test Failed",
            "As Designed",
            "Cannot Reproduce",
            "Copied to Backlog",
            "Deferred",
            "Duplicate",
            "Fixed and verified",
            "Obsolete",
            "Fixed",
            "Investigation Complete",
            "Approved",
            "Investigate",
            "Resolved in error",
            "Reactivated",
            "Regression",
            "Build Failure",
            "New"
          ],
          "helpText": "The reason why the bug is in the current state",
          "alwaysRequired": false,
          "dependentFields": [
            {
              "referenceName": "System.State",
              "name": "State",
              "url": "https://dev.azure.com/nikhil/_apis/wit/fields/System.State"
            },
            {
              "referenceName": "Microsoft.VSTS.Common.ResolvedReason",
              "name": "Resolved Reason",
              "url": "https://dev.azure.com/nikhil/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason"
            }
          ],
          "referenceName": "System.Reason",
          "name": "Reason",
          "url": "https://dev.azure.com/{project}/{templateid}/_apis/wit/fields/System.Reason"
        },
  </code></pre>
  
  <p>I am trying to figure out the right API or set of APIs that help demystify when to show what in the combo boxes, when to mark them read-only and when to let the user edit them.</p>
  
  <p>The <strong>Resolved Reason</strong> Field is further interesting. For most parts it seems to simply copy the value from the Reason field, however the Rules API (see below) does not indicate this behaviour. It looks like what the Rules API returns does not match the behaviour that this field exhibits.</p>
  
  <p>There is a concept of Rules mentioned in the REST API here - <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/rules/get?view=azure-devops-rest-5.1#processrule" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/rules/get?view=azure-devops-rest-5.1#processrule</a></p>
  
  <p>However this does not seem to give rules which specifically control "allowedValues" for fields based on value of another field as I explained above. </p>
  
  <h1>Question:</h1>
  
  <ol>
  <li>Is there an API that can give a comprehensive set of rules for fields on a work item types including their allowedValues? For e.g. the Reason or Resolved Reason field depending on the choice of State field as shown above?</li>
  </ol>