How to get the WorkItems based on "Filed Against" value?
We want to fetch the WorkItems based on specific "Field Against" value set. The below code didn't work for me and gives the error. Can you please let us know what could be wrong? Thanks in advance
I didnt find IWorkItem.FILED_AGAINST_PROPERTY hence i used CATEGORY_PROPERTY and TestProj/UI1 is the filed against value that set. ----------- IQueryableAttribute filedAgainstAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea, IWorkItem.CATEGORY_PROPERTY, auditableClient, monitor); AttributeExpression filedAgainstExpression = new AttributeExpression(filedAgainstAttribute, AttributeOperation.EQUALS, XMLString.createFromPlainText("TestProj/UI1")); IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(projectArea, filedAgainstExpression, IWorkItem.FULL_PROFILE); ------------------------------------ It gives below error at last line in the above code snippet. java.lang.IllegalArgumentException: Argument must be an instance of IAuditableHandle at com.ibm.team.workitem.common.internal.model.SetAttributeType.toString(SetAttributeType.java:73) at com.ibm.team.workitem.common.internal.expression.AttributeValueFactory$ConstantValue.saveState(AttributeValueFactory.java:58) at com.ibm.team.workitem.common.expression.AttributeExpression.saveValueProxy(AttributeExpression.java:175) at com.ibm.team.workitem.common.expression.AttributeExpression.saveState(AttributeExpression.java:165) at com.ibm.team.workitem.common.expression.Term.saveState(Term.java:209) at com.ibm.team.workitem.common.internal.expression.XMLExpressionSerializer.serialize(XMLExpressionSerializer.java:137) |
Accepted answer
Ralph Schoon (63.6k●3●36●47)
| answered Sep 04 '15, 3:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can't just put a string in there, I think. You have to find the category object from the string and then put in the ICategory object.
Sridhar Kuna selected this answer as the correct answer
Comments
Sridhar Kuna
commented Sep 14 '15, 5:38 a.m.
Thanks Ralph. I am able to figure it out with category list. The below code snippet would be helpful for others who are on same page.
|
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.