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

277 Views Asked by At

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

1

There are 1 best solutions below

1
On BEST ANSWER

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?

  1. Export the process configuration definition file:

witadmin exportprocessconfig /collection:http://servername:8080/tfs/DefaultCollection /p:YourProjectName /f:E:\temp\ProcessConfiguration.xml

  1. Open the ProcessConfiguration.xml with text editor, add property StateColors to define the state colors under Properties block, save the changes. enter image description here

  2. Import the process configuration definition back to your project:

witadmin importprocessconfig /collection:http://servername:8080/tfs/DefaultCollection /p:YourProjectName /f:E:\temp\ProcessConfiguration.xml

  1. Check the state colors:

    enter image description here

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.

enter image description here