Howto query a workitem without providing a project area
We want to implement a plain java client for RTC using REST API.
The program gets a small String presenting a Work Item ID as input and queries the RTC DB to return if such a work item exists.
But in order to have an instance of IQueryableAttribute we need to provide a project area to the API which brings an extra input 'project area name' to our program, which we need to get rid of. Also it is an unnecessary input because Work Item id is unique in the system so the query itself actually doesn't use it in the condition. The following code demonstates our issue:
Can you point me to another way of querying workitems which does not require providing a project area?
The program gets a small String presenting a Work Item ID as input and queries the RTC DB to return if such a work item exists.
But in order to have an instance of IQueryableAttribute we need to provide a project area to the API which brings an extra input 'project area name' to our program, which we need to get rid of. Also it is an unnecessary input because Work Item id is unique in the system so the query itself actually doesn't use it in the condition. The following code demonstates our issue:
//.............
IQueryableAttributeFactory factory = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE);
IQueryableAttribute idAttribute = factory.findAttribute(projectArea, attributeId, auditableCommon,monitor); //we want to get rid of the parameter projectArea
AttributeExpression idExpression = new AttributeExpression(
idAttribute, AttributeOperation.EQUALS, workItemID);
Term term = new Term(Operator.AND);
term.add(idExpression);
return queryClient.getResolvedExpressionResults(
null, term, IWorkItem.SMALL_PROFILE);
}
Can you point me to another way of querying workitems which does not require providing a project area?