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

How to construct Expression for tags?

 I am trying to construct a query thru Java API to fetch work items without any tags. 


IQueryableAttribute tagsQAttribute = qAttributeFactory.findAttribute(projectArea, IWorkItem.TAGS_PROPERTY, auditableCommon, monitor);
Expression tagDoesNotContain = new AttributeExpression(tagsQAttribute, AttributeOperation.NOT_EQUALS, "");

I am struck in constructing 'Expression' for 'tag' attribute. I don't think my implementation is correct. 

Can someone please help? 

0 votes



One answer

Permanent link
For all I can tell without actually trying, tags are treated as string. So you would use AttributeOperation.CONTAINS.
Not sure how multiple tags are represented for AttributeOperation.EQUALS. But the Equals usually does not make that much sense anyway, because there could be other tags than the one you are looking for, so contains and notcontains makes more sense.


0 votes

Comments

No luck. I tried Expression tagDoesNotContain = new AttributeExpression(tagsQAttribute, AttributeOperation.NOT_CONTAINS, ""), but the query returned all WIs instead of WIs with tags. I also tried CONTAINING, NOT_CONTAINING. I tried to put null instead of empty string, but the API didn't like it. 


In the Query editor, we form the condition as Tag 'is not' Unassigned. So i think we need to find a way to pass 'Unassigned'. 

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
× 10,936
× 411
× 24

Question asked: Dec 04 '19, 3:37 p.m.

Question was seen: 1,784 times

Last updated: Dec 06 '19, 11:05 a.m.

Confirmation Cancel Confirm