how can I read history from RTC workItem. I want to check some attribute change and its value before and after change form history. By jazz API. how its is possible? Please help .
how can I read history from RTC workItem jazz
2.3k Views Asked by Tom At
2
There are 2 best solutions below
0
On
Use the below snippet:
IWorkItem workItem = workItemClient.findWorkItemById(id, IWorkItem.FULL_PROFILE, monitor);
IItemManager itm = teamRepository.itemManager();
List history = itm.fetchAllStateHandles((IAuditableHandle) workItem.getStateHandle(), monitor);
System.out.println("Record history details:-");
for(int i = history.size() -1; i >= 0; i--){
IAuditableHandle audit = (IAuditableHandle) history.get(i);
IWorkItem workItemPrevious = (IWorkItem) teamRepository.itemManager().fetchCompleteState(audit,null);
//Operations to be carried on workItemPrevious
}
Ragarding attributes, you can see more at "Working with Work Item Attributes"
For the history, this thread can help