How do I customize the work items states - customize the list and colors? - tfs

I installed TFS 2018 on the premises and I migrated 2 project collections from a TFS 2012 server. I have a hard time finding the page/dialog where I can assign different colors to the work items states. For the previous versions, MS provided visual studio extensions:
Process Templates Editor, TFS 2015 Power Tools. I use VS 2022. I haven't been able to find an extension for editing these lists that would work with VS 2022 and TFS 2018.
Can you please tell me how can I assign different colors to the work items states, and where I can customize the list?
TIA

Currently there is no such an extension (Process Templates Editor) for VS 2022.
However, we can export the work item type and process definition files using witadmin tool, then customize it with a txt editor, then import the changed files back to your project.
To run the witadmin command-line tool, open a Command Prompt window where Visual Studio is installed. The witadmin command-line tool installs with any version of Visual Studio.
For Visual Studio 2022, it's under the following path:
%programfiles(x86)%\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
or Professional or Enterprise in place of Community, depending on the version you've installed.
Can you please tell me how can I assign different colors to the work
items states?
To set state colors, we can add the property StateColors to define the colors. See Specify properties and behaviors. Below steps for your reference:
Export the process configuration definition file:
witadmin exportprocessconfig /collection:http://servername:8080/tfs/DefaultCollection /p:YourProjectName /f:E:\temp\ProcessConfiguration.xml
Open the ProcessConfiguration.xml with text editor, add property
StateColors to define the state colors under Properties block,
save the changes.
Import the process configuration definition back to your project:
witadmin importprocessconfig /collection:http://servername:8080/tfs/DefaultCollection /p:YourProjectName /f:E:\temp\ProcessConfiguration.xml
Check the state colors:
where I can customize the list?
If you mean add or remove work item states, then you can reference below steps to do that. (Add "Test" state for Task work item type for example here)
1.Export the Task work item type:
witadmin exportwitd /collection: http://servername:8080/tfs/DefaultCollection /p:YourProjectName/f:E:\temp\Task.xml
2.Open the exported Task.xml file with text editor and add a new state Test under witd > WORKITEMTYPE > WORKFLOW > STATES:
<WORKFLOW>
<STATES>
<STATE value="Test">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ClosedDate">
<EMPTY />
</FIELD>
</FIELDS>
</STATE>
3.Modify the transitions to go through the new state (Add the transitions as needed, from ="In Progress" to="Test" for example here):
<TRANSITIONS>
<TRANSITION from="In Progress" to="Test">
<REASONS>
<DEFAULTREASON value="Ready to Test" />
</REASONS>
</TRANSITION>
4.Import the Task definition file:
witadmin importwitd /collection: http://servername:8080/tfs/DefaultCollection /p:YourProjectName /f:E:\temp\Task.xml
5.Check the state list.

Related

Trying to remove some columns from a TFS Kanban board

One of my users has discovered that 3 new columns were added to the Kanban board. I've never removed a column from a Kanban board before, so I've been researching how this might be done. It looks like I have to use a command line utility named witAdmin. Using what I found I launched the Developer Command Prompt for VS 2015 and then entered this command:
witadmin exportwitd /collection:http://ourtfsserver:8080/tfs/Enterprise%20Architecture /p:"Server 2008 Retirement" /n:Task /f:"D:\FileToExportTo.xml"
I thought opened the FileToExportTo.xml file, but I couldn't find the column headers that need to be removed, anywhere in it. So, I must have either left something off in the command line, or gave the wrong parameter. What do I need to change, please?
There is nothing wrong with your command line. But it's used to delete redundant state in task.
If you just want to remove some columns from the board. I will give you a more detail steps for your reference:
Before in the sprint board:
Steps:
Export work item (e.g. task) through WitAdmin command.
Delete not used custom state to workflow section
Export ProcessConfiguration process file through WitAdmin command.
Delete the row of state test item in TaskBacklog=>States section. For example:
<States>
<State type="Proposed" value="To Do" />
<State type="InProgress" value="In Progress" />
<State type="InProgress" value="Test" />
<State type="Complete" value="Done" />
</States>
Import modified work item file and process file to the team project
Check the result in web access.
After deleted the column:
After deleted, the customized test column "Test" is gone, hope it helps.
I talked to the former TFS administrator about this issue. He went poking around in TFS 2015 and found an alternative solution. Go to the TFS Team Project, then go to WORK. Make sure you've selected Board and then go to the gear Configuration/Settings. Under the General tab, select "Working with bugs" tab. What he found was someone had selected "Bugs appear on the backlogs and boards with tasks". It should be "Bugs appear on the backlogs and boards with requirements".

How to add columns in sprint board TFS (not backlog board)

In the newer versions I can customize the product backlog board by adding columns and set states. I want to do the same in the sprint board but I can't find that functionality. I've change the way you can work with Bugs but it still don't give me the options I want.
Pls Help
Not possible for Visual Studio Team Services(VSO) but for on-premise it is and is the same process since at least TFS 2012.
You will need to alter your process template for the Team Project to include the additional states. You can do this with either TFS Power Tools or I prefer to do it manually. You didn't specify what Process Template you are using so here it is for the SCRUM template (Others will be the same just will contain different wordings):
Export your WITD for Tasks from your dev machine via command line (I think it needs Team Explorer):
witadmin exportwitd /collection:http://servername:8080/tfs/DefaultCollection /p:"TeamProjectName" /n:Task /f:"C:\FileToExportTo.xml"
Edit this file and find the WORKFLOW section and add in your new state into STATES e.g:
<STATE value="New State" />
Next, in the TRANSITIONS section add in the required transitions and any logic associated with it e.g:
<TRANSITION from="In Progress" to="New State">
<REASONS>
<DEFAULTREASON value="New State Started" />
</REASONS>
</TRANSITION>
Save the file and import it again:
witadmin importwitd /collection:http://servername:8080/tfs /p:"TeamProjectName" /f:"C:\FileToExportTo.xml"
You should export your entire process template and you should add those files to source control. If you want to do the same for Bugs or any other work item type then you will need to export and modify those WITD's too.

Upgraded team project: adding Epic work item type

I have a TFS2015 server upgraded from TFS2013.5.
The existing team projects were created using the old template MSF For Agile 2013.x.
For these team projects I would like to enable also the Epic work item type.
According with http://blogs.msdn.com/b/tfssetup/archive/2015/09/16/configuring-the-epics-for-upgraded-team-projects-in-team-foundation-server-tfs-2015.aspx I should download the latest Agile template and import the Epic work item type.
The import of Epic type is failling with the below message:
Error importing work item type definition:
The 'refname' attribute is not declared.
So I created a new team project using the Agile template, exported the Epic work item type and compared with Epic work item type resulted from the download operation.
It seems that the differences between these two types are quite notable:
<WORKITEMTYPE name="Epic">
vs
<WORKITEMTYPE name="Epic" refname="Microsoft.VSTS.WorkItemTypes.Epic">
missing:
<FIELD name="Iteration ID" refname="System.IterationId" type="Integer" />
<FIELD name="External Link Count" refname="System.ExternalLinkCount" type="Integer" />
and so on.
Do you know why are those differences present?
The process template that you download from VSO is already prepared for Process Customization and contains extra information that an on-prem server doesn't understand yet.
In your case, you can simply remove the "refname=Microsoft.VSTS.WorkItemTypes.Epic" piece from the file and import it.
The fields that you list out are system fields (they start with System.*) and they will always be added to all WIT definitions. They don't have to be part of the xml file that you import.

TFS work items for tracking tasks

I'm using Visual Studio 2012 and TFS onlin. I have created a TFS project using "MSF for CMMI" process template because it allows devs to estimate tasks, specify the remaining, etc.
Questions:
1) How can make the estimation of the work item read only? I don't want anybody to change that value once it has been set.
2) I need to create a report that shows what each dev has done each week, indicating task and hours. I tested MS Project integration with TFS and it's great but some columns like start date and end date only exists in MS Project so I need to ask each developer when they have started and finished each task manually.
3) What reports do you recommend for tracking devs and tasks?
Thanks in advance.
Answering your first question: you'll have to modify Task work item type definition in TFS:
export existing definition using witadmin.exe tool (you can find it in your Visual Studio folder):
witadmin.exe exportwitd /collection:<collection URL> /p:<project name> /n:Task /f:task.xml
Modify exported xml by adding CANNOTLOSEVALUE and FROZEN rules to the Microsoft.VSTS.Scheduling.OriginalEstimate field definition:
<FIELD name="Original Estimate" refname="Microsoft.VSTS.Scheduling.OriginalEstimate" type="Double" reportable="measure" formula="sum">
<HELPTEXT>The original estimate of work required to complete the task (in person hours)</HELPTEXT>
<CANNOTLOSEVALUE />
<FROZEN />
</FIELD>
Import the updated xml back to TFS:
witadmin.exe importwitd /collection:<collection URL> /p:<project name> /f:task.xml

Is there a way to customize the work item colors in TFS 2012 kanban board?

I would like to differentiate the work item types (i.e. product backlog items vs bugs) using colors or icons, to improve the board visualization.
It is possible in TFS 2013.
Open the Command Prompt
cd %programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE
witadmin exportprocessconfig /collection:your col. /p:project /f:file
Edit the exported file, see below
witadmin importprocessconfig /collection:your col. /p:project /f:file
The process config should contain a section work item colors, if the section is missing just add it (e.g. at the end just before the end of ProjectProcessConfiguration)
<WorkItemColors>
<WorkItemColor primary="FF009CCC" secondary="FFD6ECF2" name="Product Backlog Item" />
<WorkItemColor primary="FFF2CB1D" secondary="FFF6F5D2" name="Task" />
<WorkItemColor primary="FFCC293D" secondary="FFFAEAE5" name="Bug" />
</WorkItemColors>
The primary color is used in lists and the secondary color in boards.
I had the exact same problem. The last 7 months or so I have built a chrome plugin that does this (and much more) in my spare time as a project to learn Javascript and to make my daily work easier. Our team and a few more is using it since a while back with good results. Now It is available for free in Chrome Store under the name TFS Kanban buddy.
https://chrome.google.com/webstore/detail/tfs-kanban-buddy/bnkanimchogkpkjbabhoficohanbhalp
The code is available on GitHub as well if someone feels like fiddling with it.
No, there is no non-hack way to change the color of the cards. This functionality is rumored to be "on the backlog" however.

Resources