title: How can I programmatically determine if a TFS WorkItem field is required?
body: <p>My project requires me to programmatically access TFS servers we don't administer and to get real time information about the fields in the WorkItemTypes. I can get the field names and most of the information I need by looking at the FieldDefinition in the WorkItemType's FieldDefinitions collection.</p>
  
  <pre><code>    public WitType(WorkItemType type)
      {
          this.Fields = new List&lt;string&gt;();
  
          foreach (FieldDefinition f in type.FieldDefinitions)
          {
              Fields.Add(f.Name);
          }
      }
  </code></pre>
  
  <p>One thing missing is the IsRequired property. I need to be able to tell if a field is required.
  I have tried running a work item story query</p>
  
  <pre><code>WorkItemCollection workItemCollection = workItemStore.Query
  foreach (WorkItem workItem in workItemCollection)
  foreach (Field field in workItem.Fields)
  {
       textBox1.Text += field.Name + " is required? " +  field.IsRequired.ToString();                 
  }
  </code></pre>
  
  <p>and then checking the IsRequired property of the Field item in the WorkItem's Fields collection.
  Only problem is that for a given work item type one work item says Title is required, then the next work item will have the IsRequired property = false.</p>
  
  <p>Is there a way to determine if a WorkItem field is required without resorting to the WIT xml file? If not, is there a way to programmatically access the WIT xml file?</p>