Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes

Comments

By the way, Workitem modification can be any kind of change either new comment addition, status change or any attribute values changes etc...



One answer

Permanent link
I would assume that that is the correct property. Have you tried that out?

0 votes

Comments

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.

yes, the filter only uses day.. not time. so you cannot get the rolling last 24 hours exactly.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943
× 411
× 169

Question asked: Sep 03 '15, 7:13 a.m.

Question was seen: 3,598 times

Last updated: Sep 03 '15, 12:35 p.m.

Confirmation Cancel Confirm