How do I query on a NOT condition?
Sometimes I need to query for work items that does not have a particular attribute. So for (very bad) example, I want query for all work items where "Story Points" attribute does not exist.
I may also want to query on NOT (and group) for exampe.
Is it possible to query on NOT condition? If not, does it make sense to raise an enhancement request on this?
2 answers
Please see this article for more details:
https://jazz.net/library/article/1007
Unless you have any specific use case and no way to achieve that in the existing query conditions(may not directly use NOT condition though), I don't think raising a RFE would help to move forward as the requirement is not clear at all at this moment.
If you do have specific use case, you may want to put the details in forum and see if there is any alternative way someone may suggest.
Comments
A specific use case can be when I create new customer attributes, ATTR say, for a specific work item type, Task say.
I would want to query for all Tasks where ATTR does not exist. Currently it is only possible to query for Tasks where ATTR exists.
Do you mean that you created a new custom attribute and some workitems were created before that and you want to find out what workitems are not having that custom attribute so that you can sync all of them?
If that is the case, I don't think you will get the correct result because the approach should be in Eclipse client > custom attribute > check attribute usage in the repository and when you see the pop up, click on the synchronization, then you can query on the Task to find out which one has no value in the custom attribute(this is to show the workitems which are just synchronized with the new attribute but no value assigned yet). So in the query, you can set type to task and then select custom attribute and then
select "is" and check unassigned to get the list.
This is an example only. If my understanding on your use case is wrong, you may want to provide more details on what you mean by "here ATTR does not exist."
Lewis,