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?
One answer
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.
Comments
MooR Rathinasamy
Dec 06 '19, 11:05 a.m.