What happens if you create a new Bug in Team Foundation Server, and if you see afterwards that this is not a bug ? Usually, you would like to reject it. But... you can't! Indeed, by default Team Foundation Server allows you to resolve a bug with one of the following reasons :
- As Designed
- Cannot Reproduce
In some cases, none of these values can do the job. So if this does not suit your need, let's see together how can we update the normal workflow to include this new value.
Use the Team Foundation Server Power Tools
This free Visual Studio extension can be found here. It will add some nice extensions to Visual Studio to help you working with the Team Foundation Server, and above all it will add a new menu in the tool menu : Process Editor.
Let's use it to update our workflow. First select the Work Item Type (WIT) you want to update
Just select the Work Item Type you want to update (here select Bug), and you will have the following screen:
Here we are interested by two tabs :
- The Fields tab list all the fields that are used in the Bug Work Item Type.
- The Workflow tab show the the different status that the Work Item Type can hold, and the transition between each state
Change the list of possible values for "Resolved Reason"
When you resolve a Work Item, you have a field called Resolved Reason that holds the reason of the resolution. In our case, we need a new value Rejected. So how do we define it ?
- Go on the Field Tab
- Select the Resolved Reason field
- Click on Edit
- On the Field Definition window, select the Rules tab
- Edit the ALLOWEDVALUES field
- Add a new value Rejected
And here it is, you have a new resolution value, that can be used in the workflow.
Note that the list we have just updated is used when performing validation of the workflow. If we do not update this list, therefore, our workflow would be valid, but when changing the resolution of a bug, we would have an error.
Update the workflow
So now, we can go back to the main screen and select the Workflow tab. You should see something like :
What does that mean ?
- The bug item type has three states : Active, Resolved and Closed
- We have an entry point leading to the Active state
- We have some transitions
- from Active to Resolved
- from Resolved to Active
- from Resolved to Close
- from Close to Active
In our case, we want to add a new way of resolving a bug, so let's double click (or right click, and Open Details) on the transition from Active to Resolve and let's create a new Transition Reason.
Now we'll need to edit this new reason. Let's go the Fields tab and let's create a new Field reference. This Field Reference will be of type ResolvedReason and will have two Rules : COPY and ALLOWEDVALUE.
How do we parameter these two Rules ? Quite Simple. We are just copying a new value, which is Rejected, and after we'll check that the value is within the list of the allowed values.
And here we are ! We just have to check that everything is ok now.
Check that the new workflow is correct
Once we have saved our Work Item Type definition, we can open a bug and check that everything is correct.