How do I find the Current Iteration of a Project Area with the Java Server API?
Accepted answer
One other answer
- IProjectArea has .getDevelopmentLines() and .getProjectDevelopmentLine()
- IDevelopmentLine has .getCurrentIteration() which returns the current iteration.
- IIteration has .getDevelopmentLine()
Comments
I'm able to get the IProjectAreaHandle from workitem.getProjectArea() but when I try to use the IRepositoryItemService.fetchItem() to get the full item from the handle, I get a null value. How do I actually get an IProjectArea object to begin that chain?
IProjectArea projectArea = (IProjectArea) repositoryItemService.fetchItem(workItem.getProjectArea(), IRepositoryItemService.COMPLETE);
Per the Javadoc, the return value 'cannot' be null... so perhaps you are calling a different method. Note: It can however throw one of several Exceptions (is it possible you are just catching that and continuing?),
* @return the item for the given item handle; the item has all its
properties set of <em>properties</em> is <code>COMPLETE</code>;
otherwise, the item is partial with the specified properties set;
the item is immutable; never <code>null</code>
* @throws PermissionDeniedException
if authenticated contributor is not authorized to read this
item from the repository
* @throws ItemNotFoundException
if the item was not found