Kanban customizable columns was made publicly available in VS Update 2. You can read the release notes for an overview of the feature itself, and you can read an in-depth article to understand what happens under the hood.
If you have an on premises installation of TFS, you might see the following error on the Kanban board
The goal of this blog post is to get this error resolved.
Why is this happening?
In the in-depth article you can read that the work items on the board have states and the board columns. When you visit the board for the first time there are no board settings yet and it provisions itself to create the initial board settings. During the provisioning the board is creating a column for all the states that are mapped in the common configuration.
Imagine that you have the following common configuration
It will create the following board by using the following rules
- Incoming column: first state in the Proposed or InProgress ‘metastate’.
- Outgoing column: last state in the Complete ‘metastate’
- In Progress: all other states
When displaying the board we run two queries, a query to get all Proposed and InProgress items and the other one for the Complete items. And this is were the bug is: it makes the (wrong) assumption that all the items returned by the Complete query are in the Outgoing (the green) column.
How to fix it?
Fortunately the bug is only in the provisioning logic. The steps that are described in the post are temporary changes to provision the board successfully and they will not cause any data loss. Once the board is provisioned, you can undo the temporary changes.
The two scenarios how you can get work items in a ‘Complete’ state which is not the Outgoing column are:
- Have multiple states mapped to the Complete metastate
- Have multiple work item types in the Requirement category, and these work item types do not share the last Complete state
Follow these steps to resolve the issue (replace the red snippets with your own values) :
- Open the Developer Command Prompt for VS2012
- Export the categories
witadmin exportcategories /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\categories.xml - Open in notepad
%windir%\system32\notepad %temp%\categories.xml - Locate the snippet:
. It should look something like the following
- Remove all work items types except the DEFAULTWORKITEMTYPE by commenting them out (so you can undo the changes), which would result in my example in
-
- Save the changes
- Import the categories
witadmin importcategories /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\categories.xml - Export the common configuration
witadmin exportcommonprocessconfig /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\commonconfig.xml - Open in notepad
%windir%\system32\notepad %temp%\commonconfig.xml - Locate the snippet:
. It should look something like the following
- Now update the mapping, so there is only one state mapped to Complete, and the work item type that was left in the Requirement category contains that state, which would result in my example in
- Save the changes
- Import the updated common configuration
witadmin importcommonprocessconfig /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\commonconfig.xml - Now visit your board to start the provisioning. Wait until the board shows up.
- You can now undo the changes in the categories and the common configuration by using the same steps
- When you now visit your board, you might get the following error, but that’s expected and let you correct the column mappings to a valid state.
Note: we have seen one case where the customer got the exception after undoing the changes. If it happens to you, you want to follow these additional steps:
- Follow again the steps 1 to 14 from above
- Go to the board
- Click on the Customize Columns, which will bring up a dialog
- Rename all column names (by adding a ‘1’ for example to the name)
- Click OK to accept the changes and close the dialog
- Undo the changes to the Requirement category and the common configuration
- Go to the board
If you still have problems, please leave a comment and we will reach out to you.