Creating a plan using RTC Java APIs?
4 answers

private void createPlan(ProjectArea projectArea, String name, ITeamAreaHandle teamHandle,IIterationHandle iteration, String type) throws TeamRepositoryException{
IIterationPlanService planService= getService(IIterationPlanService.class);
IIterationPlanRecord planRecord= (IIterationPlanRecord) IIterationPlanRecord.ITEM_TYPE.createItem();
planRecord.setName(name);
planRecord.setIteration(iteration);
planRecord.setPlanType(type);
planRecord.setOwner(teamHandle);
planService.save(projectArea, planRecord, null);
}
See if this works.
IIterationPlanService planService= getService(IIterationPlanService.class);
IIterationPlanRecord planRecord= (IIterationPlanRecord) IIterationPlanRecord.ITEM_TYPE.createItem();
planRecord.setName(name);
planRecord.setIteration(iteration);
planRecord.setPlanType(type);
planRecord.setOwner(teamHandle);
planService.save(projectArea, planRecord, null);
}
See if this works.
Comments

Thank you. With this I do not get an exception on save. The plan is created and I can select it on the UI. BUT: if I open the plan I get now a runtime error on the UI: "Error - [object Object] TypeError: _89 is undefined" or "[Error - [object Object] TypeError: 'length' is null or not an object" (both seen)

Does the plan open through the RTC Eclipse client? As far as I recall, there was bug that prevented opening plans in Web UI (also Jazz may have issued a fix for some version - check with members on the Jazz team).
Comments

Good point! The plan opens in Eclipse. I'm using V.3.0.1.3. I will test on 4.0. I'm in duscusion with Development on WI https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=65697

was this issue been resolved withe the Web UI ?

This doesn't work for me. 3.0.1.3. I get no errors, but nothing appears.
I left off the wiki to try, still nothing.
I did get a permissions error the first time, as I didn't have plan save permission

if I run my app on the system where I created the plans(4.0.3 GM). the missing plans show up in the list of all plans from
Never mind, dumb user error and poor checking on
planService.save(project, plan, wiki);
i used a bad IIteration Handle for the plan iteration. (iteration hadle not valid on this repository)
should have thrown an error.
Never mind, dumb user error and poor checking on
planService.save(project, plan, wiki);
i used a bad IIteration Handle for the plan iteration. (iteration hadle not valid on this repository)
should have thrown an error.
Comments
Guido Schneider
Jul 20 '12, 5:54 a.m.Hello Debdoot, have you ever found a solution? may you post a code snippet for this, if you got it? thanks Guido