How to Create Expression for Field Against attribute using Java API
Exception in thread "main" java.lang.IllegalArgumentException: Argument must be an instance of IAuditableHandle
at com.ibm.team.workitem.common.internal.model.SetAttributeType.toString(SetAttributeType.java)
at com.ibm.team.workitem.common.internal.expression.AttributeValueFactory$ConstantValue.saveState(AttributeValueFactory.java)
at com.ibm.team.workitem.common.expression.AttributeExpression.saveValueProxy(AttributeExpression.java)
at com.ibm.team.workitem.common.expression.AttributeExpression.saveState(AttributeExpression.java)
at com.ibm.team.workitem.common.expression.Term.saveState(Term.java)
at com.ibm.team.workitem.common.internal.expression.XMLExpressionSerializer.serialize(XMLExpressionSerializer.java)
at com.ibm.team.workitem.common.internal.expression.XMLExpressionSerializer.serialize(XMLExpressionSerializer.java)
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorCustomImpl.setExpression(QueryDescriptorCustomImpl.java)
at com.ibm.team.workitem.common.internal.query.impl.QueryDescriptorCustomImpl.setExpression(QueryDescriptorCustomImpl.java)
at com.ibm.team.workitem.common.internal.query.QueryCommon.createQuery(QueryCommon.java)
at com.ibm.team.workitem.common.internal.query.QueryCommon.getResolvedExpressionResults(QueryCommon.java)
One answer
See https://jazz.net/forum/questions/244541/how-to-create-expression-for-planned-for-attribute-using-java-api/244553
Also on of the examples of questions that fall into the "to be ignored" category based on the lack of useful information in the question. Learn here: How should I ask a question in the Forum if I want to receive useful answers?
Comments
It is basically the same problem and same approaches apply. You can't pass a string, you have to find the category. Tons of examples for this kind of stuff here: https://rsjazz.wordpress.com/
You can also use Google on this site. This question has been answered before here.