How to get history of project area by JAVA API?
![]()
How to get Project Area History from IAuditable interface ? My code like below
List<IAuditableHandle> iAuditableHandles; IAuditable iAuditable; iAuditableHandles = itemManager.fetchAllStateHandles(projectArea.getPredecessorState(), nPMonitor);
for(IAuditableHandle iaHandle : iAuditableHandles) { iAuditable = itemManager.fetchCompleteState(iaHandle, nPMonitor); // here I want to get history of project area , like which user added/removed scenario
} |
2 answers
![]() Comments No . above question discussion about Iteration history . Not project history . I tried same way , but no luck . The project area history is the only place that contains the iteration creation and deletion information as far as I can tell. I would consider to really read the whole set of answers. A colleague used that approach and found what they where looking as far as I can tell.
I cross verified multiple times . IDevelopmentLine not return the history project . it is returning iteration Details 1
As Jared points out there are more objects involved here. I cite:
Key things to understand about the data we store and the history of that data: 1. There are three types of "items" involved here: project areas (IProjectArea), timelines (IDevelopmentLine), and iterations (IIteration). 2. All these items inherit from IAuditable, which inherits from IItem. 3. Every time an IAuditable is saved, it generates a new "state". 4. When you fetch an IAuditable from the repository, you get the current state. 5. IAuditable#getPredecessorState() will give you access to next oldest state. And that predecessor will have a pointer to the next predecessor once you fetch itYou want to do this on the IProjetArea and not on the iteration, obviously. Can you please provide the code with example ? Hi Varathan,
I am working on the same. Were you able to fetch the history of PA using java api.
Thanks in advance.
showing 5 of 6
show 1 more comments
|
![]() Hello,
IContributorHandle modifierHandle = projectArea.getModifiedBy(); IContributor modifier = repository.itemManager().fetchCompleteItem(modifierHandle, IItemManager.REFRESH, monitor);
IProjectArea prevPA=projectArea; while(it != null) { System.out.println("Change made by : ");
modifierHandle = prevPA.getModifiedBy(); modifier = repository.itemManager().fetchCompleteItem(modifierHandle, IItemManager.REFRESH, monitor); System.out.println(modifier.getUserId());
} Once again it is not optimized code, and it is perfectible, but it is a start for people who would like to do the same (because in my case I have several users with the same name and different IDs and I would like to see exactly who modified the members list as it is not possible to see in the history in the web client). Hope this could help! Marie |
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.