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
<RequirementWorkItems category="Microsoft.RequirementCategory" plural="Stories">
<States>
<State value="New" type="Proposed" />
<State value="Active" type="InProgress" />
<State value="Resolved" type="InProgress" />
<State value="Closed" type="Complete" />
</States>
</RequirementWorkItems>
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 bold 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%system32notepad %temp%categories.xml
- Locate the snippet: <CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">. It should look something like the following
<CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">
<DEFAULTWORKITEMTYPE name="Product Backlog Item" />
<WORKITEMTYPE name="Bug" />
</CATEGORY> - 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
<CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">
<DEFAULTWORKITEMTYPE name="Product Backlog Item" />
<!– <WORKITEMTYPE name="Bug" /> –> - </CATEGORY>
- 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%system32notepad %temp%commonconfig.xml
- Locate the snippet: <RequirementWorkItems category="Microsoft.RequirementCategory" plural="Backlog items">. It should look something like the following
<RequirementWorkItems category="Microsoft.RequirementCategory" plural="Backlog items">
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Committed" />
<State type="Complete" value="Approved" />
<State type="Complete" value="Done" />
</States>
</RequirementWorkItems> - Now update the mapping, so only the last state (based on the order you had defined in the States section of the RequirementsWorkItems) is 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
<RequirementWorkItems category="Microsoft.RequirementCategory" plural="Backlog items">
<States>
<State type="Proposed" value="New" />
<State type="InProgress" value="Committed" />
<State type="InProgress" value="Approved" />
<State type="Complete" value="Done" />
</States>
</RequirementWorkItems> - 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 an 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.
0 comments