TFS & Visual Studio ALM – by Neno Loje

(formerly Team System, VSTS)

Setting Remaining Work to Zero when closing a work item in TFS

July 30th, 2009 · 2 Comments · Team Foundation Server, TFS Process Customization, TFS Tips and Tricks, TFS Work Item Tracking, VSTS

Question:

How can I make sure that the "Remaining Work" field is set to 0 when the work item is closed (for example when associating a work item during checking-in)?

Short Answer:

You can achieve this using the <COPY> rule on the transition to the "Closed" state.

Step-by-Step instructions:

  1. For the desired transition (in this example from "Active" to "Closed").

    Edit the Workflow Transition with Process Template Editor (part of TFS Power Tools)

  2. Add a field reference to "Microsoft.VSTS.Scheduling.RemainingWork"

    Choose the desired field 

  3. Add a new rule of type "COPY"

    You can use the copy rule to set values

  4. Choose From = "value" and enter value = "0"

    The copy rule sets a value to a field

  5. The resulting XML should look something like

     XML under the covers defines our new rule

  6. Verification: After transitioning a task work item from "Active" to the "Closed" state "Remaining Work" is set to zero.

    Work Item History shows the new rule in beeing applied on the state transition. 

Tags:

2 Comments so far ↓

  • Haobo

    Hi, thanks for the good sharing, can I ask what is the tool you are using in the captures above? Thanks a lot!

    • vstsblog

      Haobo,
      Sure – I’m using Snagit (www.snagit.com) for screenshots, as it has many nice options to highlight and crop images in various ways.
      –Neno

Leave a Comment

*