JazzPlainJavaClient: how to use Identifier in query?
I am using JazzPlainJavaClient to make a query program. I has met a problem in my coding: I want to query work items with the condition of severity. This is My code:
1.String severity_normal = "severity.literal.l3"; 2.Identifier sIdentifier = Identifier.create (classType, severity_normal); 3.IQueryableAttribute severityAttribute = findAttribute (projectArea, auditableClient, IWorkItem.SEVERITY_PROPERTY, null); 4.AttributeExpression severityExpression = new AttributeExpression (severityAttribute, AttributeOperation.EQUALS, sIdentifier); Is it a correct way to create AttributeExpression of severity? And what value should be set to the param "classType" in the row #2 |
Accepted answer
I am using JazzPlainJavaClient to make a query program. I has met a Yes, this looks correct. I think passing in the string instead of the identifier is possible, too. The classType argument for the Identifier would be ISeverity.class in your example above. Regards, Patrick Jazz Work Item Team Ralph Schoon selected this answer as the correct answer
|
3 other answers
I am using JazzPlainJavaClient to make a query program. I has met a Yes, this looks correct. I think passing in the string instead of the identifier is possible, too. The classType argument for the Identifier would be ISeverity.class in your example above. Regards, Patrick Jazz Work Item Team My problem has benn resolved. Thank you for your reply. Now two new puzzles appears. (1) When a IWorkItem instance is got,how to get its "phase found" and "find in" property(IWorkItem.FOUND_IN_PROPERTY)? I can not find any method to get them. (2) About the "phase found". I want to create AttributeExpression for it; but I can not find its PROPERTY value defined(like PROPERTY value defined as IWorkItem.FOUND_IN_PROPERTY) in class IWorkItem .Does it have a alias or is there any other way to get it? |
My problem has benn resolved. Thank you for your reply. Now two new You read all attribute values of a work item using Object value= IWorkItem#getValue(IAttribute attribute); where IAttribute attribute= workItemClient.findAttribute(projectArea, attributeId, monitor) Patrick Jazz Work Item Team Comments 1
Jia Jia Li
commented Sep 04 '12, 1:51 p.m.
If for enum custom attribute, how to create the identifier? In you example, you can use ISeverity.class, for custom attribute, which class should I use? Identifier sIdentifier2 = Identifier.create(com.ibm.team.workitem.common.model.ISeverity.class,severity_2); |
For Enumeration/Enumeration List customization attribute, you should use com.ibm.team.workitem.common.model.ILiteral
|
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.