How to get Project Area History using java API
![]()
I want to read/fetch all the history data for project area (Not work item) . Is this possible thru JAVA API ?
thanks Akshay P. |
One answer
![]()
private static IProjectArea getFirstProjectAreaState(ITeamRepository repo, IProjectArea projectArea) throws TeamRepositoryException{
List history = repo.itemManager().fetchAllStateHandles(projectArea, null);
List<IProjectArea> projectAreas = (List<IProjectArea>)repo.itemManager().fetchCompleteStates(history, null);
Collections.sort(projectAreas, new Comparator<IProjectArea>(){
public int compare(IProjectArea o1, IProjectArea o2) {
int result = 0;
if (o1.modified().getTime() < o2.modified().getTime()) {
result = -1;
} else {
result = 1;
}
return result;
}
});
IProjectArea firstHistoryEntry = projectAreas.get(0);
return firstHistoryEntry;
}
|
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.