Why does Deletion of an Iteration programatically throw ProcessDataValidationException ?
Following is my code to delete iteration from a project area :
for (Object obj : itemManager.fetchCompleteItems(
Arrays.asList(workingDevLine.getIterations()),
IItemManager.DEFAULT, monitor)) {
IIteration iter = null;
if (obj instanceof IIteration) {
iter = (IIteration) obj;
workingDevLine.removeIteration(iter);
}
I am recieving the following error message :
com.ibm.team.process.common.service.ProcessDataValidationException: Iteration 'FY14Q3' has a backpointer to timeline 'Project_Timeline', but the timeline does not contain it.
An explanation about this error might be helpful.
3 answers
When you use IDevelopmentLine.removeIteration() to remove an iteration, you should also have to remove the reference of development line from the iteration that is about to be removed.
For example:
developmentLine.removeIteration(iteration);
iteration.setDevelopmentLine(null);
iteration.setDevelopmentLine(null);
If you just want to delete a iteration, you can use com.ibm.team.process.client.IProcessItemService.delete(IProcessItemHandle, boolean, IProgressMonitor) on client site.