Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?

0 votes



2 answers

Permanent link
Surely NOT condition is achievable and existing in the Query condition.
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.

1 vote

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, 


why does the built in synchronization not work? (just asking).

many times when I want to do something, I have to read the product source code (shipped in the SDK) to find out how the product does it. 
Shift+Alt+F1 in eclipse will tell you plugin and class involved, you can import the plugin as source from the plugins view.. 

in this case the plugin-spy info looks like this 


Permanent link
There are some terms that explicitly allow you to say "NOT xxx" in the query term, but there is no generic NOT operator.  It has been requested in work item Add "AND Not" to query sets for "false" boolean operator. (178802).   Please feel free to add a comment to indicate your interest/support.

1 vote

Comments

Thanks Geoff. I did not realize NOT operator is not there. Even though we may be able to achieve something similar with the existing operators for most queries, if NOT operator is provided, it would make things simple for some use cases.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 201

Question asked: Apr 07 '14, 2:04 a.m.

Question was seen: 5,376 times

Last updated: Apr 07 '14, 8:28 a.m.

Confirmation Cancel Confirm