Here's the rules on ReadOnly fields for VS 2012 going forward. Note that this was NOT the behavior for VS 2010 and before. This is unfortunately undocumented and IMHO counter-intuitive.
- If a field is ReadOnly AND Empty, it will disappear from the form
- If it is only ReadOnly BUT has a value, it will still be on the form but not editable.
For example, the PBI work item has a condition that when it goes into the “Done” state, it makes both the “Business Value” and Effort field go ReadOnly as shown in the XML below from its Work Item Type Definition (WITD):
<STATE value="Done">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.BusinessValue">
<READONLY />
</FIELD>
<FIELD refname="Microsoft.VSTS.Scheduling.Effort">
<READONLY />
</FIELD>
</FIELDS>
</STATE>
This forum post speaks to the behavior somewhat as well. Also, when you use the “EMPTY” attribute on a work item field, it will disappear from the form and wouldn’t you know it, “EMPTY” is a combo of “READONLY” and emptying out the field.
So it all makes sense, kinda, in the end. :)