It's all about the answers!

Ask a question

I want to get the work items resolved on specific date and time using RTC query.

Sneha Bhaskar (11) | asked Sep 26, 1:06 a.m.


I want to fetch the ALM workitems resolved on a specific date and time using RTC query.
But when I am querying, I am getting the query result only based on the Date value. Time is ignored. 

Kindly provide your insights on fetching ALM workitems resolved on a specific date and time using RTC query. 

Please find below sample code snippet used for querying. 

java.sql.Timestamp timestampTill = new java.sql.Timestamp(calendar.getTime().getTime());

IQueryableAttribute resolutionDateAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE)
        .findAttribute(projectArea, IWorkItem.RESOLUTION_DATE_PROPERTY, iauditableCommon, progressMonitor);

Expression resDateTillExp = new AttributeExpression(resolutionDateAttribute, AttributeOperation.BEFORE, timestampTill);

Term queryTerm = new Term(Term.Operator.AND);

queryResult = queryClient.getResolvedExpressionResults(projectArea, queryTerm, IWorkItem.FULL_PROFILE);

Please let me know if there is any other ways we can fetch the workitems based on Date and time value.

Thanks in advance,
Sneha Bhaskar

One answer

permanent link
Ralph Schoon (62.7k33643) | answered Sep 26, 1:51 a.m.

 I'd suggest to build the query in the Tool UI. Once you have that, you should have all information needed to create it as query/expression.

Your answer

Register or to post your answer.