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
2. Select your Project Collection (in this case DefaultCollection)
3. Select your Team Project then Product Backlog Item
4. The Work Item Editor will show allowing you to Add/Edit Fields, Modify the Layout and Customize the Workflow
Adding a new field – Deployed in Version
- In the Fields tab click New
- Fill in the following fields:
- Name: Deployed in Version
- Display name of the field
- Type: String
- Type of the field
- Reference Name: EricPhan.DeployedInVersion
- Internal identifier for the field (used in reports, forms etc)
- Help Text
- Descriptive text about the field, will show in tooltip
- Reportable: Dimension
- Allows you to define how this field should be used in the TfsAnalysis cube. Options are:
- Dimension – if you want to use the values of this fields as a filter
- 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
- Detail – if this field is just data
- None
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:
- Select the Workflow tab
- Scroll across and double click the Done state
- You will notice that there are already some rules for BusinessValue and Effort.
- Click New
- Select the EricPhan.DeployedInVersion field we created from before
- Click the Rules tab | New
- Select the REQUIRED rule
- 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
The last thing we need to do is show the field in the Work Item UI. For this:
- Click the Layout tab
- Right click one of columns and New Control
- Specify the Field Name and Label
- Click Preview Form to check our field is visible
- Save the Work Item Type
We can now test our customizations