How can i get the history of the work item in the plugin using server SDK?
Hi everyone,
I want to retrieve the work item history and i have a requirement to know the details of the attributes in advisor plugin, that were undergone changes with the current save operation of the work item i.e i want to get the difference between the old state and the new state of the work item .
For better understanding,
I created a work item with summary and category and saved it. Then i added Description when i opened it in the next time . So i want to get the details that "Description" was added newly . in short i want to get the history.
I tried my best to explain.
Kindly help me to solve this.
Thanking you.
-Jyothsna.
One answer
The states are stored in the state table. As far as i know the interface IAuditable provides the access to the historical data.
com.ibm.team.repository.common.IAuditable
You can get the PredecessorState and the MergedPredecessor State from that interface. See below how to get all states.
Comments
Hi Ralph,
Thanks for your reply. But i couldn't understand how to get the history from Predecessor state and Merged Predecessor State .If you don't mind please explain the things in a clear way.
Waiting for your reply..
Thank you
Hi everyone,
Could you please explain the predecessor and mergedPredecesssors or suggest any docs related to it.
Thanks in advance.
The documentation of com.ibm.team.repository.common.IAuditable explains what the operations do. Basically return a previous (history) state of the item. Read the documentation. If you can't setup the SDK development environment. I have hinted to execute the RTC Extensions Workshop several times before. If you have, you can search for interfaces, references, types, examples. If not, you should not develop for the SDK.
I mention https://jazz.net/forum/questions/7046/how-to-get-the-history-of-an-work-item that mentions to use IItemManager.fetchAllStateHandles() and other interesting options to deal with the history states of an com.ibm.team.repository.common.IAuditable .
I never had the time to create a simple example for this, but you should have enough to get started.