Required fields on state change

So, you have a field which you want to make required when the state of a work item changes to a given value. How do you do it? Well, I had to do it for a customer recently and forgot how difficult it can be so I thought I’d blog it. Be aware that there are probably multiple ways to do this but I’m going to give you what I think is the most logical way to do it!

 You’ll need the TFS Power Tools to do it the way I’m describing it (that’s the easiest way) – hopefully I’ll get around to adding screenshots later on.

Select the work item you want to edit and go to the Workflow tab. Select the state (outlined in red) and do the following:

  1. Right-click and select Open Details
  2. Add the Ref Name for the field you want to make required for the selected state
  3. Open this row and select the Rules tab
  4. Add the WHEN condition (this is the part that just isn’t intuitive)
  5. Set the field (maybe System.Reason since that’s tied to the state change)  and set the value the field needs to be in order for the field you want to be required to be required (read it slowly – it’s confusing)
  6. On the Rules tab add the Required condition (don’t need to fill in the For or Not values)

Enjoy.

About Jeff Levinson

Jeff Levinson is the Application Lifecycle Management Practice Lead for Northwest Cadence. He has a Masters in Software Engineering from Carnegie Mellon University and holds the following credentials: MCP, MCAD, MCSD, MCDBA, MCTS, MCT, SCJP, Security+, CTT+ and is a Certified Scrum Master (CSM). He is the author of three books dealing with software development: Building Client/Server Applications with VB.NET, Pro Visual Studio 2005 Team System, Pro Visual Studio Team System with Database Professionals. He has written several articles for Visual Studio Magazine, writes a twice-monthly column for VSM Online and is a regular speaker at industry events (VS Live! & Tech Ed). Jeff is formerly a Solution Design & Integration Architect for The Boeing Company and is a Microsoft Team System MVP.
This entry was posted in FUQ and tagged , . Bookmark the permalink.