microsoft / wiql-editor

Search work items with wiql queries.
https://marketplace.visualstudio.com/items?itemName=ms-devlabs.wiql-editor
MIT License
4 stars 1 forks source link

Must Contain AND being treated as an OR #43

Open eliteslayer opened 3 months ago

eliteslayer commented 3 months ago

This query should only show results for items linked to "X" but not "Y". However this does not seem to treat the AND correctly.

SELECT [System.Id], [System.Title], [Microsoft.VSTS.Common.Severity], [System.AreaPath], [Custom.BugState], [System.State], [Custom.MilestoneIDList], [System.CreatedDate], [System.WorkItemType] FROM workitemLinks WHERE ( [Source].[System.WorkItemType] = 'Bug' AND NOT [Source].[System.Title] CONTAINS 'Squish' AND [Source].[Custom.BugState] <> 'Closed' AND NOT [Source].[System.Title] CONTAINS 'Integration' ) AND ( [System.Links.LinkType] = 'System.LinkTypes.Related-Forward' ) AND ( [Target].[System.WorkItemType] = 'Milestone' AND [Target].[System.Title] CONTAINS 'X' AND NOT [Target].[System.Title] CONTAINS 'Y' ) ORDER BY [System.AreaPath], [System.Id] MODE (MustContain)

AminTi commented 2 months ago

Hi, I will take a look at it and get back to you.