locked
Can you copy Work Item Queries from one Collection/Project to another? RRS feed

  • Question

  • Hello all.  New here, so be gentle!

    I have been working on a proof of concept of customization of Work Items and Work Item Queries in a "test" Project Collection and "test" Team Project.  I would like to be able to copy the WI queries from test to the "production" Project Collection and "production" Team Project.  Is there a way to do this, or do I have to re-key each query?

    Thanks for any responses!

    edit: I am using Team System 2010.

    Tuesday, May 18, 2010 7:04 PM

Answers

  • You can open a query and then save it to a file (File -> Save As). You can then open the other project collection and then open the saved query. You can again choose the save as option, and now you can save it to the team queries of your team project.
    Ewald - Please remember to mark the replies as answers if they help.

    Ewald Hofman
    Blog: www.ewaldhofman.nl
    • Marked as answer by kkennedy Wednesday, May 19, 2010 10:43 PM
    Wednesday, May 19, 2010 6:17 AM

All replies

  • You can open a query and then save it to a file (File -> Save As). You can then open the other project collection and then open the saved query. You can again choose the save as option, and now you can save it to the team queries of your team project.
    Ewald - Please remember to mark the replies as answers if they help.

    Ewald Hofman
    Blog: www.ewaldhofman.nl
    • Marked as answer by kkennedy Wednesday, May 19, 2010 10:43 PM
    Wednesday, May 19, 2010 6:17 AM
  • Ewald,

    Thanks for the reply!  

    I did get it to work (steps to follow).  I was hoping that there was some way to import queries since I will have over 30 to move to the production Team Collection/Team Project.  Is there a way to import queries like you import Work Items?

     

    Here are the manual steps to get one Work Item Query copied from one Collection/Project to another:

    1. Open query in edit mode in original Collection, and File -> Save As... to a *.wiq file on your system.

    2. Edit the *.wiq file in an XML editor to change the <TeamFoundationServer> and <TeamProject> tags.

    3. Connect to the other Collection/Project, and drag the .wiq file to the Visual Studio editor.

    4. Make some change to the query (otherwise, Save and Save As are greyed out).

    5. Do File -> Save As and select the appropriate Project and folder to save it to.

     

    Thanks again.  If no "better" (read more automated) reply comes later, I will mark your response as Answer.

     

    Wednesday, May 19, 2010 6:24 PM
  • I assume the best/only way to do this is doing File -> Save As.  Thanks for the answer, Ewald!
    Wednesday, May 19, 2010 10:43 PM
  • Thanks Ewald's kindly help and thanks for kkennedy's sharing!

    Best Regards,

    Cathy Kong

    Thursday, May 20, 2010 1:48 AM
    Moderator