It's all about the answers!

Ask a question

Howto query a workitem without providing a project area

Caner Kaplıca (121) | asked Jul 29 '10, 11:25 a.m.
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:

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);

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?

Be the first one to answer this question!

Register or to post 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.