Book Image

Team Foundation Server 2013 Customization

By : Gordon Beeming
Book Image

Team Foundation Server 2013 Customization

By: Gordon Beeming

Overview of this book

<p>Team Foundation Server offers you the benefit of having all your data in one system with all tools tightly integrated with each other, making it easier for teams to work together. Knowing how to customize the Team Foundation Server is very useful as well as powerful. Having the knowledge and applying it to TFS can save users many hours as well as make it easier to understand the data in TFS for reporting purposes.</p> <p>This book will show you how to customize various TFS features in order to create an enhanced experience for your users and improve their productivity. You will create custom controls that will be used in client applications and inside the web access. Next, you will learn how to embed a web page inside your work items to display rich information linked to the work items you are opening.</p> <p>This book will show you how to modify a team’s process template, and then slowly get to grips with some C# code and create a scheduled job.</p> <p>Using this book, you will create a JavaScript web access plugin that greatly increases productivity. You will start off by making various modifications to the process template to illustrate how we can cater to custom data requirements, and then we will move towards writing code to perform more complex customizations.</p> <p>Customizing Team Foundation Server 2013 is one of the best methods you can use to provide rich data for reporting in TFS.</p>
Table of Contents (13 chapters)
Team Foundation Server 2013 Customization
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a new portfolio to the process template


Lots of companies use different portfolios to categorize and define/understand the scope of work. The default TFS Scrum template contains a Feature, Product Backlog item portfolio. Today, we are going to create a level, Epic, which is above Feature. TFS supports up to seven different portfolio levels.

We aren't going to focus on what fields are available for the new Epic Work Item Type, but rather what is required to add it to our TFS process template.

Creating a new work item type definition

The first step is to create a copy of the existing Feature.xml in the TypeDefinitions folder (C:\ProcessTemplates\Microsoft Visual Studio Scrum 2013\WorkItem Tracking\TypeDefinitions) and name it Epic.xml. Open the Epic.xml file in your favorite editor. Then locate and change the name attribute on the WORKITEMTYPE node to Epic.

Adding a new portfolio backlog

Now, open the ProcessConfiguration.xml file that is located in C:\ProcessTemplates\Microsoft Visual Studio Scrum 2013\WorkItem Tracking\Process. In the PortfolioBacklogs node, add the .xml shown as follows:

<PortfolioBacklog category="Microsoft.EpicCategory" pluralName="Epics" singularName="Epic">
  <States>
    <State value="New" type="Proposed" />
    <State value="In Progress" type="InProgress" />
    <State value="Done" type="Complete" />
  </States>
  <Columns>
    <Column refname="System.WorkItemType" width="100" />
    <Column refname="System.Title" width="400" />
    <Column refname="System.State" width="100" />
    <Column refname="Microsoft.VSTS.Common.BusinessValue" width="50" />
    <Column refname="System.Tags" width="200" />
  </Columns>
  <AddPanel>
    <Fields>
      <Field refname="System.Title" />
    </Fields>
  </AddPanel>
</PortfolioBacklog>

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

This XML blurb is the same as the default Features, but with a small change on the first line. We are specifying that this is the Microsoft.EpicCategory category, and we changed the plural and singular names for the work item type to Epics and Epic. You will also need to add the attribute parent="Microsoft.EpicCategory" to the Feature portfolio to state that the new Epic category is the parent of Feature.

You will also need to find the WorkItemColors node and add the following node to specify the color to be used for the Epic work item type.

<WorkItemColor primary="FFFF5900" secondary="FFFFA200" name="Epic" />

This line simply specifies the primary and secondary colors to be used when displaying this work item on the boards and in grids. This helps users of TFS to easily identify a work item by its color, instead of looking for its work item type in the text.

Adding a new work item category

Next, open the Categories.xml file that is in C:\ProcessTemplates\Microsoft Visual Studio Scrum 2013\WorkItem Tracking, and add the following XML under the cat:CATEGORIES node:

  <CATEGORY name="Epic Category" refname="Microsoft.EpicCategory">
    <DEFAULTWORKITEMTYPE name="Epic" />
  </CATEGORY>

This will let TFS know that there is an Epic category available and the default work item type for the Epic category is our new Epic work item type.

Importing a new work item portfolio

Importing a new work item or changes made to a work item category will require you to import three files (the ones we just edited). You can accomplish this by opening the Developer Command Prompt for VS2013 and importing the files as discussed in the following sections.

Importing the work item type definition

Importing WITD is the same as what we did earlier. This is a regular import of the WITD using the witadmin tool.

cd C:\ProcessTemplates\Microsoft Visual Studio Scrum 2013\WorkItem Tracking\TypeDefinitions
witadmin importwitd /collection:http://localhost:8080/tfs /p:Demo /f:Epic.xml

Your new Epic work item type now exists in TFS.

Importing the categories file

We can use the importcategories tool to import categories. This is shown as follows:

cd C:\ProcessTemplates\Microsoft Visual Studio Scrum 2013\WorkItem Tracking
witadmin importcategories /collection:http://localhost:8080/tfs /p:Demo /f:Categories.xml

This process will update all category information in TFS.

Importing the process configuration file

We can use the importprocessconfig tool to import the process configuration files as follows:

cd C:\ProcessTemplates\Microsoft Visual Studio Scrum 2013\WorkItem Tracking\Process
witadmin importprocessconfig /collection:http://localhost:8080/tfs /p:Demo /f:ProcessConfiguration.xml

This will import all the process template configuration files into TFS.