Using a TFS Query

A TFS query can be used to specify which work items will be synchronized with TeamPulse.  Only work items returned by the query will be synchronized from TFS to TeamPulse.  Using a query makes it possible to synchronize a subset of work items.

 

How to specify a query

  1. Using Visual Studio, use Team Explorer to find or create a TFS query that will be used for specifying which work items to sync with TeamPulse.  For example, if multiple projects are being run out of a single TFS project, a query can be created that selects work items under a sepcific area path.
    TFS queryenlarge screenshot 
  2. In TeamPulse, from the ribbon, go to Project > View TFS Sync Information.
  3. If the TeamPulse project is not already connected to a TFS project, connect it now.
  4. Expand the Remote Server Configuration section and choose Edit Synchronization Mappings.
  5. In the <ConfigSettings> section, add a <ConfigSetting> element with a key of TfsQuery and a value corresponding to the path of the query from step 1.

    <ConfigSetting Key="TfsQuery" Value="Team Queries\Sync\Sub-project 1" />

    TFS query sync settingsenlarge screenshot 
  6. When finished, click Save to save your settings.
    • If there are any validation errors, they will be displayed to the right of the textbox.

 

How the query is used

  • The TFS query is used when looking for changes in TFS, such as new or modified work items.
  • If the query returns work items of types that are not mapped in the synchronization mappings, the unmapped work item types will be ignored and will not be synchronized.
  • If the query returns work items that do not belong to the TFS project being synchronized, the work items from other projects will be ignored and will not be synchronized.

 

If a synchronization has already been performed and a query is added or changed, work items that are no longer returned by the query but that still exist in TeamPulse will continue to be synchronized from TeamPulse to TFS, but not from TFS to TeamPulse.  This is because the query is only used when checking for changes in TFS, but not when checking for changes made in TeamPulse.