It's all about the answers!

Ask a question

How to exclude work items from a plan that are not tagged wit specific tags.


0
1
Mounir bsaibes (231814) | asked Nov 04 '16, 12:26 p.m.
I need to exclude Work items from my plan that do not include either one of 2 different tags.
In another words there are some work items that have Tag1 some other work items that have Tag2. I want to include the items with Tag1 & Tag2 but  exclude all others.
I used the exclude expression as follows:
exclude !tags: Tag1 Tag2 but that did not work.
Any suggestion how to go about that?

2 answers



permanent link
Shawn Maclaga (1963) | answered Nov 07 '16, 9:39 a.m.
Mounir bsaibes,
You should be able to use the syntax:
!tags:tag1 !tags:tag2

There's some discussion on this behavior in:
Quick query syntax AND is not working as expected. (384442)

Shawn

Comments
Mounir bsaibes commented Nov 07 '16, 10:28 a.m.

!tags:tag1 !tags:tag2 syntax is not working as expected. instead of the union of work items with Tag1 and Tag2, it seems it is taking the Work items with Tag1 and then reducing the list to include the Work items with Tag2. So effectively it is listing the Work items that have both Tag1 and Tag2. This is not what I am looking for. I am looking to include all Work Items that have either Tag1, Tag2 or both. Since the Plan only allows us to exclude, I want to exclude all work items that Do Not  have Tag1, Tag2 or both.


Shawn Maclaga commented Nov 08 '16, 8:42 a.m.

Mounir bsaibes,
It looks like your expectations match with the description's steps to reproduce (step #7) from defect 384442. If you are using a version 4.04 through 6.0.1, this is the problem that you're experiencing and it's fixed in 6.0.2.

Shawn


permanent link
Matt Muller (59813674) | answered Nov 08 '16, 5:04 a.m.
I had the same problem when using the !expression...   I've seen it work on 6.0.2 but not on 4.0.7
I used Expression:  !tags:Tag1 !tags:Tag2  this worked ok.
Also you may want to try !tags:"Tag 1" !tags:"Tag2"



Comments
Mounir bsaibes commented Nov 08 '16, 9:29 a.m.

Thanks Shawn & Matt,
We are still at 6.0.1. I will wait to check when we upgrade to 6.0.2
Mounir

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.