Continuous Learning and Sharing of Team Foundation Server and Application Lifecycle Management RSS 2.0
# Friday, November 27, 2009

Earlier this week at the Omaha Team System User Group someone asked about how to add new statuses to a work item in TFS.   I mentioned I had the steps documented that I would send him.  After reviewing the steps I thought it would be useful if I posted this for everyone. 

Download and Install the TFS Power Tools

Unless you prefer editing XML and running command line utilities to GUI editing, the first thing you should do is download the latest edition of TFS Power Tools.  The Power Tools are a must have Team Foundation Server add-on that Microsoft has used to add functionality since the release of TFS Power Tools.  There has been several updates with October 2008 being the latest release.

Download Visual Studio Team System 2008 Team Foundation Server Power Tools - October 2008 Release

Work Item Template Process Editor

After the TFS Power Tools are installed,  Process Editor is now available under the Tools menu item.

image

 

Opening a Work Item Template for One Team Project

To edit a Work Item Template (WIT) there are a couple options.  To modify the template for one project, you can open the WIT directly from the project, edit it, and save it back to that project by choosing the “Open WIT from Server” option.
When you choose “Open WIT from Server”, it will display a dialog with all of the team projects and the templates.  In this example, the Bug WIT from the SampleScrum template is chosen.

image

 

Opening a Work Item Template for Multiple Team Projects

To edit a WIT for multiple team projects, you will want to export the template to a file, edit the changes and then import that change into each of the team projects.
To Export the WIT, choose Export WIT.   This displays the dialog to select the WIT.

image

Save the WIT to a location on your local machine.

image

It will prompt you if you would like to include the Global List definition.  You can choose No.
Next open the saved WIT by choosing “Open WIT from File” and selecting the saved file (Bug.xml). 

 

Editing the Work Item Template

The Work Item Template Editor has three tabs.  In this example we don’t change any of the fields or the layout of the work item, so we can ignore these tabs.

image

To add statuses to the Work Item, we will modify the Workflow tab.  Adding a status is more than just adding the option to a list.  The statuses of a work item are part of the workflow.  Basically each status is only available when it is enabled in the workflow.  For example, you might have a “Fixed” status and a “In Test” status.  In the workflow, you can define it so that “In Test” won’t be available to select until it has been marked “Fixed” first.

Here is an example of the workflow tab

image

The different Statuses in Red and the arrows show the flow of one status to the next.   Once it is decided when the new statuses will appear and what statuses will be available after the new status, we can add the statuses and connect them to the other statuses.

Add a Status by selecting the State item in the Toolbox  (if the Toolbox is not visible, choose View -> Toolbox from the menu.

image

Drag the State item to the canvas in an area where it will be easier to connect it to the other States.  If the workflow becomes cluttered, you can right click on it and choose “Reset Layout”

image

When you have added the status to the canvas it will look similar to this

image 

Give the status a name by typing over the State1 text

image

Now, connect this to the previous status.  For this example the bug will go from “In Progress” to “Fixed” to “Ready For Test”.  Do this by clicking on the Transaction Link from the Toolbox, this will change your cursor to the link cursor.  Click and hold on the starting Status and drag the line to the target Status.  This will add the line between the two and create a Transition box.

image

For the new status to be valid, you must give the Transition a Reason.  This is just a textual explanation why it would move to this status from the previous.  Expand the Transition box so it shows the Reasons, Actions, and Fields.  Right click on the box and choose “Open Details”.  A Workflow Transition dialog box will display.  Choose the Reasons tab and modify the Value to display the text you would like.

image

Add a second Transaction Link from the new status (Fixed) to the Target status (Ready for Retest) and give it a reason.
Once this is added, you can validate your workflow by right clicking on the canvas and choosing “Validate All”.

image

If there are any errors in the validation they will be displayed in the Error List.

image

If there are no errors the Output tab will look similar to this

image

Click the save button in the toolbar to save the WIT.   If you have opened the WIT from the server then this saves it back to the Team Project and is available.  If this was a File then you must import it into the appropriate Team Project(s).
To Import the Work Item Template, choose “Import WIT” from the menu.  This dialog will display.  Select the file that was edited (Bug.xml) and then select the team project and click OK.

image

Repeat to add to the other Team Projects.

 

Applying Change to Process Template


Now that the work item is modified, if you want this change to be in new projects created you must update the source and re-upload the templates.
Copy the bug.xml and bug.wit to the source template folder on the TFS Server.  The Default location is
C:\Program Files\Conchango\Scrum for Team System\ProcessTemplate\AgileSoftwareDevelopmentwithScrum\WorkItemTracking\TypeDefinitions

image

To upload the template, right click on the TFS root node in the Team Explorer and choose “Process Template Manager”.

image

A dialog will display that contains a list of the installed templates.  Click on the Upload and browse to:
C:\Program Files\Conchango\Scrum for Team System\ProcessTemplate\AgileSoftwareDevelopmentwithScrum
Open the ProcessTemplate.xml file.

It will next prompt you if you want to overwrite. Choose Yes and it will upload the changes. If you do not wish to overwrite it, then you must change the name by opening the same ProcessTemplate.xml with the Process Editor.

image

 

That completes the steps to modify the Work Item Templates, apply the changes to one or multiple team projects, and also back to the template for future projects created with the the process template.

Mike

Friday, November 27, 2009 10:56:00 AM (Central Standard Time, UTC-06:00)  #    Comments [1] -
Team Foundation Server

Tuesday, July 13, 2010 4:46:47 PM (Central Daylight Time, UTC-05:00)
I am concerned on naming primarily... Why is this not called the work item "TYPE" editor. Aren't work item "TEMPLATES" the pre-filled work items seen in Team Explorer just above work items in a team project? Maybe this is just an oversihgt that has gone viral - but since we try to search based on keywords, using them poorly probably matters.

LOVE the post otherwise! For some reason, it is difficult to find visual guidance(i.e. screenshots) on this (Visual) tool!! :-)
JWS
Comments are closed.
Visual Studio ALM MVP
Microsoft Visual Studio ALM MVP
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Mike Douglas
Sign In
Statistics
Total Posts: 76
This Year: 0
This Month: 0
This Week: 0
Comments: 52
All Content © 2012, Mike Douglas
DasBlog theme 'Business' created by Christoph De Baene (delarou)