It's all about the answers!

Ask a question

How to directly query workitem History in RTC using Java API


Neha Sharma (136) | asked Aug 25 '15, 1:43 a.m.
 I want to get workitems by querying RTC based on workitem's history.

Something like this:
IQueryableAttribute recAttr1 = factory.findAttribute(projectArea, IItem.HISTORY_PROPERTY, auditableClient, null );
AttributeExpression projectExpr = new AttributeExpression(projectAttr, AttributeOperation.EQUALS, projectArea);
AttributeExpression recExpr1 = new AttributeExpression(recAttr1, AttributeOperation.AFTER, timeStamp ); 
Term term= new Term(Operator.AND); 
term.add(recExpr1); 

IQueryClient queryClient = (IQueryClient) teamRepository.getClientLibrary(IQueryClient.class); 
IQueryResult<IResolvedResult<IWorkItem>> result = queryClient.getResolvedExpressionResults(projectArea, (Expression)term,    IWorkItem.FULL_PROFILE);
	
Is there any property like below?

IItem.HISTORY_PROPERTY

The usual approach is to first query workitem and then for workitem get the history. In this apporach I would endup fetching workitems that will not be relevant for me so I need to get specific workitems based on its history date and time. Is that possible?



Be the first one to answer this question!


Register or to post your answer.