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
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
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
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
3 other answers
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
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
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?
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