Question

I am trying to add a new string field (IterationCompleted) to the bug work item in tfs2010. Using the TFS 2010 power tools I edited the work item adding the new field. This results in the following XML

<FieldDefinition reportable="dimension" refname="DevX.IterationCompleted" name="Iteration Completed" type="String">
  <ALLOWEDVALUES>
    <GLOBALLIST name="Iterations" />
  </ALLOWEDVALUES>
  <ALLOWEXISTINGVALUE />
  <DEFAULT from="value" value="∞" />
</FieldDefinition>

I added it to the form next to some related fields. Here is the relevant XML

<Group Label="Classification">
  <Column PercentWidth="100">
    <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="&amp;Area:" LabelPosition="Left" />
    <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Ite&amp;ration Found:" LabelPosition="Left" />
    <Control FieldName="DevX.IterationCompleted" Type="FieldControl" Label="Iteration Resolved:" LabelPosition="Left" Name="IterationCompleted" />
    <Control FieldName="DevX.Customer" Type="FieldControl" Label="Customer:" LabelPosition="Left" />
    <Control FieldName="DevX.ReleaseNotes" Type="FieldControl" Label="Include in Release Notes:" LabelPosition="Left" />
    <Control FieldName="DevX.Billable" Type="FieldControl" Label="Billable:" LabelPosition="Left" Name="Billable" />
  </Column>
</Group>

It is not involved in the workflow at all.

The problem I'm having is in the form. For new bugs, the field appears as expected and is editable (Iteration Resolved):

Field editable

For old bugs however, the field is not editable. In fact there is no control at all there to input anything:

Field not editable

I found a similar question with an accepted answer to make sure the field is String and that on the Form the type is set to FieldControl. As you can see I have done that and still get the results I am seeing above. I have successfully added fields in the past and never encountered this problem. Does anyone know what I can do to get this field editable in old bugs?

Was it helpful?

Solution

I just had this problem in TFS 2010 using VS2012.

Steps to reproduce:

  1. Create custom field type:String
  2. Add field to layout, ensure it is a FieldControl
  3. Preview Form: Works fine
  4. Go to a query and double click and existing work item of the type you are editing (for me it was a Backlog Item.) Observe no proper way to edit field, even if cursor shows in field. Appears to be read only.

After verifying the field was not read only (Property false in layout), I restarted Visual Studio after saving the edits.

That cleared the issue and the edit control started working normally. I can reproduce this over and over.

OTHER TIPS

I came across the same behaviour... Or at least similar...

I had to add default values for all the lists..

When I did not have a default value, any WIT's which had already been created could not have there values set, as it was not a ALLOWEDVAULES LISTITEM...

(Note: This code/XML changes the value of a list depending on the state of the WIT)

Sample:

<FIELD reportable="dimension" refname="GovDept.ActionRequiredTFS" name="Action Reqd TFS" type="String">
    <WHEN field="System.State" value="Proposed">
      <ALLOWEDVALUES>
        <LISTITEM value="Assess" />
        <LISTITEM value="Prioritize" />
      </ALLOWEDVALUES>
      <DEFAULT from="value" value="Assess" />
    </WHEN>
    <WHEN field="System.State" value="Active">
      <ALLOWEDVALUES>
        <LISTITEM value="IA Complete" />
        <LISTITEM value="Impact" />
        <LISTITEM value="Implement" />
        <LISTITEM value="Migrate" />
        <LISTITEM value="Unit Test" />
        <LISTITEM value="Fix Fail" />
      </ALLOWEDVALUES>
      <DEFAULT from="value" value="Impact" />
    </WHEN>
    <WHEN field="System.State" value="Resolved">
      <ALLOWEDVALUES>
        <LISTITEM value="Test" />
        <LISTITEM value="Fix Fail" />
      </ALLOWEDVALUES>
      <DEFAULT from="value" value="Test" />
    </WHEN>
    <ALLOWEXISTINGVALUE />
  </FIELD>

End of Sample

Dustin,

We have never heard of this behavior. If you want Microsoft to take a look at this issue, you can file a bug at https://connect.microsoft.com/visualstudio

Ewald Hofman TFS Program Manager

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top