1

Is there a way in which we can add rules in the workflow diagram of the work item (Task) so that when the task is closed it will automatically change the completed work to original estimate and remaining work to zero.

I am using the process editor in TFS 2010.

krafty
  • 425
  • 4
  • 16
  • FWIW, IMHO, Automatically setting the completed work hours to the original estimate is not a good idea. The value of "completed work" is for historical purposes. It allows individuals/teams to compare the original estimate and the actual work so that the estimation quality & accuracy can be evaluated and learned from. Is there a pattern estimates too low or too high? What are the causes of incorrect estimates -- requirements to vague, external dependencies, new requirements mid-task? Also it doesn't give credit for efficiently working or committing more effort than planned/expected. – Adam Porad May 09 '19 at 18:08
  • Ok, that is a valid point, how about it calculates the hours taken for the transition from "in progress" to "done"? User can always override the value, this is just a suggestive value. – krafty May 11 '19 at 01:17

1 Answers1

2

I thought it did this by default - at least for Tasks in the MSF Agile 5.0 process template it does.

Anyway, what you need is a rule on the Transition from Active to Closed to copy some values and and empty the remaining work:

<TRANSITION from="Active" to="Closed">
    <!--Reasons snipped -->
    <FIELDS>
        <!--Other fields snipped -->
        <FIELD refname="Microsoft.VSTS.Scheduling.RemainingWork">
          <EMPTY />
        </FIELD>
        <FIELD refname="Microsoft.VSTS.Scheduling.OriginalEstimate">
          <WHEN field="Microsoft.VSTS.Scheduling.OriginalEstimate" value="">
            <COPY from="field" field="Microsoft.VSTS.Scheduling.CompletedWork" />
          </WHEN>
        </FIELD>
        <FIELD refname="Microsoft.VSTS.Scheduling.CompletedWork">
          <WHEN field="Microsoft.VSTS.Scheduling.CompletedWork" value="">
            <COPY from="field" field="Microsoft.VSTS.Scheduling.OriginalEstimate" />
          </WHEN>
        </FIELD>
    </FIELDS>
</TRANSITION>
DaveShaw
  • 52,123
  • 16
  • 112
  • 141