TFS 2013 - Add custom swim lane to the Task Board
TFS 2013 Team Web Access (TWA) allows easy lightweight customisation to the Kanban Board (http://blogs.msdn.com/b/visualstudioalm/archive/2013/03/05/tfs-kanban-board-swim-lane-customization-walk-through.aspx) in order to be able to add additional swim lanes without having to edit the underlying TFS process template. However, if you want to add an additional Task status, how do you go about that and ensure that the TWA Task Board displays your additional state transition. Let's take a look.
First off, you will need to tweak the TFS Project Process Template to add your custom state transition. The easiest way to do this is using the TFS Power Tools here: http://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f
Once this is installed, you'll need to Open up Visual Studio and go to the Tools - Process Editor - Work Item Types - Open WIT from Server* eg:
*It's recommended that you back up your work item type definitions before making any changes or try out any changes first on a test TFS project.
Select the TFS project that you want to change and then the work item type Task eg:
Now add the new status where you need them. Here, I'm adding the status "Nearly Done" between In Progress and Done, so the workflow is now:
To Do - In Progress - Nearly Done - Done
Also add the Transitions between the statuses that you need with a relevant Reason. Ordinarily here you would ensure that you have transitions both ways so that a work item can go back and forth between transitions eg. from "Nearly Done" back to "In Progress". Your workflow will now look something like this:
Next up, save the work item. When viewing the item within Visual Studio or TWA our new state will now be displayed:
We are nearly there, but we need to add a swim lane to the TWA Task Board, so that the work item card can be dragged and dropped to automatically update the status. To do this we need to drop to the command line and use the "witadmin exportprocessconfig" command documented here: http://msdn.microsoft.com/en-us/library/hh500413.aspx eg:
witadmin exportprocessconfig /collection:http://vsalm:8080/tfs/fabrikamfibercollection /p:FabrikamFiber /f:"c:\util\pc.xml"
This will create a file called pc.xml that you will need to edit so that TWA knows it needs to display your new status. Open the fie and look for the <TaskBacklog> element. Within this element you'll see some <State> nodes eg:
<State type="Proposed" value="To Do" />
<State type="InProgress" value="In Progress" />
<State type="InProgress" value="Nearly Done" />
<State type="Complete" value="Done" />
Above, I've already added my new state "Nearly Done" to the type "InProgress". This how we map the work item definition workflow state to a metastate which determines how the agile planning tools treat each workflow state. There are only three metastates which are used by TFS "Proposed" "InProgress" and "Done". The "InProgress" state is used to indicate that work items are inflight or actively being worked on, which is true of the "Nearly Done" state. For more information on mapping workflow states to metastates see this article: http://msdn.microsoft.com/en-us/library/hh500408.aspx.
Once you've saved the file, you're now ready to import it back into TFS (I've attached a sample file below). Again, we do this from the command line eg:
witadm importprocessconfig /collection:http://vsalm:8080/tfs/fabrikamfibercollection /p:FabrikamFiber /f:"c:\util\pc.xml"
Once this is done, you can now refresh TWA Task Board and you should now see your new state has it's own swim lane you can interact with.