Fetch Workitems which are modified last 24 hours(1day)
We want to retrieve workItems modified from yesterday (last 24 hours). We have tried as below but it didn't fetch WI's correctly. Please let us know what can be wrong? Not sure IWorkItem.MODIFIED_PROPERTY is the correct one to declare here.
Calendar cal = Calendar.getInstance(); cal.add(Calendar.DAY_OF_YEAR, -1); Date yesterdayDate = cal.getTime(); Timestamp yesterdayTimestamp = new Timestamp(yesterdayDate.getTime()); IQueryableAttribute lastModifiedAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea, IWorkItem.MODIFIED_PROPERTY, auditableClient, monitor); Expression lastModifiedExpression = new AttributeExpression(lastModifiedAttribute, AttributeOperation.AFTER, yesterdayTimestamp); com.ibm.team.workitem.common.query.IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(projectArea, lastModifiedExpression, IWorkItem.FULL_PROFILE); ---------------- |
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Sep 03 '15, 10:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I would assume that that is the correct property. Have you tried that out?
Comments
Sridhar Kuna
commented Sep 03 '15, 11:48 a.m.
Thanks for your reply Ralph. I have tried it but it is only considering day not the full timestamp. i mean it is retrieving all workitems modified from yesterday(on yesterday date) but not from yesterday timestamp.
sam detweiler
commented Sep 03 '15, 12:35 p.m.
yes, the filter only uses day.. not time. so you cannot get the rolling last 24 hours exactly.
|
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.
Comments
By the way, Workitem modification can be any kind of change either new comment addition, status change or any attribute values changes etc...