Duplicate queries in tfs between iterations

One of the most common operation when you move to another iteration is moving queries to the new one. Here is a sample, this is the Iteration 1 of the TailSpin Toys of the Demo Tfs machine. image

Figure 1: Team project queries of the Iteration 1

As you can see you have a lot of queries under the Iteration 1 path, and if you open one of them, you can see that in definition it got a filter to grab only Iteration 1 bugs:

image

Figure 2: Definition of the Active Bugs query under the Iteration 1 path.

Now suppose you need to move to Iteration 2, you clearly want to copy all the query from the Iteration 1 Folder to the Iteration 2 folder, and at the same time changing all the definition to apply a filter to the new iteration. With few lines of code made with TFS API I build a simple and primitive command line utils that can be used in this way.

1
2
3
4
5
6
7
8
TfsUtils
DuplicateQuery
/collection:"http://10.0.0.101:8080/tfs/DefaultCollection"
/user:abuobe
/pwd:P2ssw0rd
/teamproject:"Tailspin Toys"
/iterationsource:"Iteration 1"
/iterationdest:"Iteration 2"

After I run this command I have all the queries duplicated in the new iteration.

image

Figure 3: All the Queries were copied from the Iteration 1 to Iteration 2

The cool part is that if I open the Active Bugs query I got:

image

Figure 4: The copied query automatically point to the new iteration

As soon as possible I’ll release those few lines of codes. Actually I’ve not tested it extensively, and only tried with the sample data of the sample Virtual Machine.

alk.