How can I read history from RTC workItem jazz
2 answers
Attribute markup, you can see more at Working with Work Item Attributes "
If you have an attribute id available as a string, you can use this code to get the attribute.
IWorkItemClient workItemClient = (IWorkItemClient) fTeamRepository.getClientLibrary(IWorkItemClient.class);
IAttribute someAttribute= workItemClient.findAttribute(fProjectArea, "some_attribute_ID", monitor);
For history, this thread might help
you can use
IItemManager.fetchCompleteState()
to get the complete item in its historical state.
If you want to get the full story, you can also get all the state handles at once usingIItemManager.fetchAllStateHandles()
instead of walking through the story usingIAuditable.getPredecessorState()
.
+1
source to share
Use the snippet below:
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
}
0
source to share