In the introduction post, I introduced the Work Item Templates feature in the latest power tools release. This post will talk about how you can use work item templates to do bulk edits.
Let's take the following scenario: We want to move several tasks from one iteration into another.
Starting with a set of tasks that are all on the V1.1 iteration:
We'll create a template which only sets the Iteration Path. Note that we kept all other fields blank, even though they are required.
After saving the work item template, we look at our query again and select those items we want to move to Iteration V2
Then we right-click on the work item template we just created and select "Apply Template"
This will apply any values set in the template to all the work items selected in the query:
Select "Save All" and you are done. Pretty sweet, huh?
What if applying the template causes one of the selected templates to violate a business rule? TFS won't let you save, then you can open the work item and investigate what the problem is.
Some other applications I've come up with for this feature are:
- Assigning to a particular area path, for example, taking a task or bug and moving it into my area.
- Setting a state to Resolved or Closed. In fact, I keep a "Set to Resolved" and "Set to Closed" work item template handy for this purpose.
I'm sure you'll think of good ones as well.