The Team Foundation Server Power Tools allow you to edit templates online or offline. In the online mode, changes you make are instantly visible when you save the changes so be careful. I would advise creating a dummy Team Project to do the customizations on first before rolling the changes out to actual Team Projects. The offline mode works by saving the work item definitions locally as XML and making changes to the XML file. You will need to import the XML to the Team Project to deploy the changes.

So let’s take a look at adding a the following fields to Product Backlog Item WIT of the Scrum 1.0 template:

  • Deployed in Version
  • Actual Hours
  • Estimated Hours

Note: I know Actual/Estimates aren’t part of Scrum, but the higher-ups like to track it. It’s “Scrum-But” :)

1. Tools | Process Editor | Work Item Types | Open WIT From Server

clip_image001

2. Select your Project Collection (in this case DefaultCollection)

clip_image002

3. Select your Team Project then Product Backlog Item

clip_image003

4. The Work Item Editor will show allowing you to Add/Edit Fields, Modify the Layout and Customize the Workflow

clip_image004

Adding a new field – Deployed in Version

  1. In the Fields tab click New
  2. Fill in the following fields:
    1. Name: Deployed in Version
      1. Display name of the field
    2. Type: String
      1. Type of the field
    3. Reference Name: EricPhan.DeployedInVersion
      1. Internal identifier for the field (used in reports, forms etc)
    4. Help Text
      1. Descriptive text about the field, will show in tooltip
    5. Reportable: Dimension
      1. Allows you to define how this field should be used in the TfsAnalysis cube. Options are:
        1. Dimension – if you want to use the values of this fields as a filter
        2. Measure – if you want to be able to report on this field (you also need to select the Formula which determines how this field will be aggregated e.g. Sum, Average or Count
        3. Detail – if this field is just data
        4. None

clip_image005

The Rules tab allows you to specify rules for the field. The options available are:

  • ALLOWEDVALUES – Turns the field into a drop down list of predefined values
  • ALLOWEXISTINGVALUE – Keeps the existing value even if it is invalid/not part of the ALLOWEDVALUES rule
  • CANNOTLOSEVALUE – Can’t remove the value after it is assigned
  • COPY – Copy the value from another field
  • DEFAULT – Specify a default value for the field
  • EMPTY – Clears the value from the field and does not allow editing
  • FROZEN – Can’t change the value of the field to a non-empty one (you can still clear the field then assign another value)
  • MATCH – Defines a pattern that the string value must match
  • NOTSAMEAS – Check that the value is different from another field’s value e.g. Tester and Assigned To can’t be the same person
  • PROHIBITEDVALUES – Set of invalid values
  • READONLY – Makes the field read only
  • REQUIRED – Makes the field a required field
  • SERVERDEFAULT – Default value as assigned by the TFS Server
  • SUGGESTEDVALUES – Like ALLOWEDVALUES but user can type in something not in the list
  • VALIDUSER – Matches a valid TFS User
  • WHEN, WHENNOT, WHENCHANGED, WHENNOTCHANGED – Specifies conditions on the fields when their values are based on other fields

For this field, we don’t need to specify any rules here, but you could do things like: give it ALLOWEDVALUES and specify v1 – v10, mark it as REQUIRED or give it a MATCH expression

For this field, I want to force the user to assign a version to deploy to once it’s been marked as Complete. To do this:

  1. Select the Workflow tab
  2. Scroll across and double click the Done state

    clip_image006

  3. You will notice that there are already some rules for BusinessValue and Effort.
  4. Click New

    clip_image007
  5. Select the EricPhan.DeployedInVersion field we created from before

    clip_image008
  6. Click the Rules tab | New

    clip_image009
  7. Select the REQUIRED rule

    clip_image010
  8. Keep clicking OK and save the work item type

Note: You will see this additional dialog box to configure the REQUIRED rule. You don’t need to specify anything, but it will allow you to implement the rule only for certain groups

clip_image011

The last thing we need to do is show the field in the Work Item UI. For this:

  1. Click the Layout tab
  2. Right click one of columns and New Control
    clip_image012

  3. Specify the Field Name and Label

    clip_image013
  4. Click Preview Form to check our field is visible
  5. Save the Work Item Type

We can now test our customizations

  1. Create a New Product Backlog Item
  2. We can see the Deployed In Version field

    clip_image014
  3. Save
  4. Progress the PBI to Done
  5. We can see our rule kicks in to mark the Deployed In Version as required

    clip_image015

2 Comments