Querying for Unresolved items via Plain Java API
Hi,
I see a few attempts to ask this question in the past, but no accepted answers.
Surely someone out there is doing this successfully?
I have other code that works fine for querying work items for various attributes, but cannot see how to query for Unresolved items.
I tried the approach below, but I get an exception at the point noted: com.ibm.team.repository.common.query.QueryException: Unknown queryable reference: stateGroup
qattr3 = factory.findAttribute(projectArea, "stateGroup", auClient, null);
expr3 = new AttributeExpression(qattr3, AttributeOperation.NOT_EQUALS, new Integer(IWorkflowInfo.CLOSED_STATES));
Term term = new Term(Term.Operator.AND);
term.add(expr1); // Work item is of correct type - code ommitted
term.add(expr2); // Work item is owned by me - code omitted
term.add(expr3); // Work item is unresolved
resolvedResults = quClient.getResolvedExpressionResults(projectArea, term, IWorkItem.FULL_PROFILE);
if ( resolvedResults != null )
{
while ( resolvedResults.hasNext(null) ) // Exception occurs here
{
Any ideas how to query for only unresolved items, please?
One answer
There are some hints here: https://www.google.com/search?&q=find+unresolved+work+items+site%3Ajazz.net
Comments
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 12 '20, 3:26 p.m.Are you sure the exception occurs the first time through the loop? If not, one would need to see the rest of the loop body.
Martin Gompertz
Apr 12 '20, 3:36 p.m.Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Apr 13 '20, 11:19 a.m.Note that my comment was just to clarify the question .. I personally do not know these APIs.
Martin Gompertz
Apr 13 '20, 11:09 a.m.This causes an exception from resolvedResults.hasNext :
expr3 = new AttributeExpression(qattr3, AttributeOperation.NOT_EQUALS, IWorkflowInfo.CLOSED_STATES);
This does not:
expr3 = new AttributeExpression(qattr3, AttributeOperation.STATE_GROUP_NOT_EQUALS, IWorkflowInfo.CLOSED_STATES);