It's all about the answers!

Ask a question

Use the following code for get historical record of one workitem, but cannot get all the history info?

Susie Wang (111) | asked Nov 14 '18, 3:20 a.m.

 IItemManager itm = m_repository.itemManager(); 

 List history = itm.fetchAllStateHandles((IAuditableHandle) workItem.getStateHandle(), m_monitor);
 for(int i = history.size() -1; i >= 0; i--)
IAuditableHandle audit = (IAuditableHandle) history.get(i);
IWorkItem workItemPrevious = (IWorkItem) m_repository.itemManager().fetchCompleteState(audit,null);
Date recordModifiedDate = workItemPrevious.modified();
        System.out.println( recordModifiedDate);

Get modified record today, will lose some information, but yesterday's change records, found that is not lost.

One answer

permanent link
Luis Peregrina (18114) | answered Nov 23 '18, 4:40 p.m.

 Hello Sussie, if I remember correctly the fetchAllStateHandles returns a non-linked list, meaning that the database does not guarantee order, so you would have to check the modified date and restructure in another list.

Your answer

Register or to post your answer.