DevOps query unable to exclude work items that contain specific set of tags

815 Views Asked by At

I have 4 DevOps tags and 3 scenarios:

  1. Work items that only contain 1 out of the 4 tags
  2. Work items that contain all 4 tags
  3. Work items that contain more than 1 but less than 4

I'm trying to build the following queries and having issues with 2-5:

  1. return work items that contain all 4 tags (no issues)
  2. return work items that contain tag 1 but do not contain tag 2 AND tag 3 AND tag 4
  3. return work items that contain tag 2 but do not contain tag 1 AND tag 3 AND tag 4
  4. return work items that contain tag 3 but do not contain tag 1 AND tag 2 AND tag 4
  5. return work items that contain tag 4 but do not contain tag 1 AND tag 2 AND tag 3

Query 1 (successful - only returns items that contain all 4 tags)

Contains Tag 1 And Contains Tag 2 And Contains Tag 3 And Contains Tag 4 (clauses are grouped)

However, when I try the opposite it is also excluding work items that only contain 2 of the tags e.g., work items that only contain Tag 1 and Tag 3. The query seems to be treating them as ‘or’ instead of ‘and’ and I can’t figure out where I’m going wrong:

Query 2

Does not Contain Tag 2 AND Does not Contain Tag 3 AND Does not Contain Tag 4 (clauses are grouped)

Any suggestions would be greatly appreciated!

Cordelle

UDPATE WITH USER SCREENSHOTS:

enter image description here

enter image description here

1

There are 1 best solutions below

4
Shamrai Aleksander On

It works. All tags: enter image description here

contain tag 1 but do not contain tag 2 AND tag 3 AND tag 4

enter image description here

contain tag 2 but do not contain tag 1 AND tag 3 AND tag 4

enter image description here

or more complex query

enter image description here

Additional one:

enter image description here