microsoft / azure-repos-vscode

Azure Repos extension for VS Code
Other
662 stars 451 forks source link

The setting team.pinnedQueries in VSCode doesn't return the correct result #549

Closed louagej closed 5 years ago

louagej commented 5 years ago

Hi,

When I query my workitems directly in Azure on New and Active work items, I get one workitem as result. 2019_07_15_005

When I Use the pin in VSCode I receive all my workitems (16). 2019_07_15_004

So it seems that the @Me filter is working, but the WHERE clause was dropped somewhere along the road. This is the configuration in VSCode

"team.pinnedQueries": [
    {
      "account": "dev.azure.com/mycompany",
      "queryText": "SELECT * FROM WorkItems WHERE [System.AssignedTo] = @Me AND ([System.State] = 'New' OR [System.State] = 'Active')"
    }
]
louagej commented 5 years ago

For anyone struggling with the same issue, here's the solution: Replace dev.azure.com/mycompany into global and add [System.TeamProject] = @project to only see the current work items from you project:

,
  "team.pinnedQueries": [
    {
      "account": "global",
      "queryText": "SELECT * FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.TeamProject] = @project AND ([System.State] = 'New' OR [System.State] = 'Active')"
    }
  ]