Question

I've updated my bug in template in tfs 2012 to reflect a custom workflow process for our bug tracking. Everything works fine until the final transition is hit in which the the closed date field is set. When this transition occurs I get an error: TF237165: Team Foundation could not update the work item because of a validation error on the server. This may happen because the work item type has been modified or...

Commenting out the field assignment code allows the process to complete without error. I'm not seeing anything obvious when comparing my altered workflow with the out of the box workflow.

Here is the xml for the custom workflow:

<WORKFLOW>
  <STATES>
    <STATE value="New">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <EMPTY />
        </FIELD>
      </FIELDS>
    </STATE>
    <STATE value="Approved">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <EMPTY />
        </FIELD>
      </FIELDS>
    </STATE>
    <STATE value="Fixed in Dev">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <EMPTY />
        </FIELD>
      </FIELDS>
    </STATE>

    <STATE value="Deployed">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <EMPTY />
        </FIELD>
      </FIELDS>
    </STATE>

    <STATE value="Verified">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <EMPTY />
        </FIELD>
      </FIELDS>
    </STATE>

    <STATE value="Resolved">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Scheduling.Effort">
          <READONLY />
        </FIELD>
      </FIELDS>
    </STATE>                
  </STATES>


  <TRANSITIONS>
    <TRANSITION from="" to="New">
      <REASONS>
        <DEFAULTREASON value="New defect reported" />
              <REASON value="Build Failure" />
      </REASONS>         
    </TRANSITION>
    <TRANSITION from="New" to="Fixed in Dev">
      <REASONS>
        <DEFAULTREASON value="Bug fixed" />
      </REASONS>
    </TRANSITION>
    <TRANSITION from="Fixed in Dev" to="Deployed">
      <REASONS>
        <DEFAULTREASON value="Fix deployed to test" />
      </REASONS>
    </TRANSITION>
    <TRANSITION from="Deployed" to="Verified">
      <REASONS>
        <DEFAULTREASON value="Fix is verified in test" />
      </REASONS>          
    </TRANSITION>
    <TRANSITION from="Verified" to="Resolved">
      <REASONS>
        <DEFAULTREASON value="Bug resolved" />
      </REASONS>
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
          <SERVERDEFAULT from="clock" />
        </FIELD>
      </FIELDS>
    </TRANSITION>        
  </TRANSITIONS>
</WORKFLOW>
Was it helpful?

Solution

I would guess that the <EMPTY> in:

<STATE value="Verified">
  <FIELDS>
    <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
      <EMPTY />
    </FIELD>
  </FIELDS>
</STATE>

is conflicting with the assignment.

Try moving your <EMPTY>'s to the transitions instead of the states. That way when someone moves to a state, the field will still be emptied, you will get the same result, just a different implementation.

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