copy plans in project to a different project, help
![]()
sam detweiler (12.5k●6●194●201)
| asked Mar 04 '14, 7:17 a.m.
edited Mar 04 '14, 11:36 p.m. by Sreerupa Sen (1.0k●4)
in our project copy utility, I support copying plans from one project to another. One area not copied is the plan views.
(maybe called Plan Modes). anyone played with accessing these thru a plainjava application? I don't want to 'present' them, just copy their data to another plan. I 'think' based on looking at the plan editor code, I need access to the IterationPlanData object, which can be retrieved thru the IIterationPlan. but attemping this on a Release Backlog plan IterationPlanData prodpd= ((IterationPlanClient)prodplanClient).fetchIterationPlanData((IIterationPlanRecordHandle) prodipr.getItemHandle(), new mylog()); gets me a fatal exception error Reference problem: Unable to find IPlanCheckDescription with id com.ibm.team.apt.plancheck.requiredAttribute. |
3 answers
![]()
Hi Sam,
did you resolve your Exception Error? I can't tell you about the Plain Java API but with the RTC SDK the following can be used (may also work with the Plain API). // The iteration plan record of the target plan you created IIterationPlanRecord iterationPlanRecord = ...; and the createSharedPlanMode method could looks like this: private ISharedPlanMode createSharedPlanMode(IterationPlanData data, XMLMemento memento) { ResolvedPlanMode planMode = data.getPlanModes().get(data.getPlanModes().size()-1); Comments I have not solved my problem, but thank you SO much.. I will report back as soon as I can..
I have started integrating you code into my app.. I have some questions/comments
1. as written you function can only work on the same system, not across systems
(only one plan client handle, plan owner not checked across system, target plan loaded from source system.
sharedPlanMode.setOwner(data.getOwner());
sharedPlanMode.setPlan(sharedPlanModeCopy.getPlan());
2. it looks like you only copy 1 plan view.. do u assume only one needs to be copied.
there is no loop around sharedPlanModes.add(targetSharedPlanMode );
3. in the subroutine, I do not undestand
ResolvedPlanMode planMode = data.getPlanModes().get(data.getPlanModes().size()-1);
why get only the last planmode everytime?
Hi Sam,
yes, indeed 3 depends on info I wouldn't have guessed
but then I don't see the rest of the views.. only 1.
if PlanData.getPlanModes() returns the iterations of a view.
Did you try this out only with newly created plans, or with existing ones (for which you already tampered with the views).
the source project has a number of custom views, which may have multiple iterations, no way of knowing
I still have the exception trying to load the plandata for the newly created plan.
last thing I did
DTO_IterationPlanSaveResult saveResult = planService.save(project, plan, wiki);
if (saveResult.isSetIterationPlanRecord() == false)
{
System.out.println("Saving failed!");
}
else
{
newplanRecord=saveResult.getIterationPlanRecord();
}
and fetch on the newplanRecord fails
Hmm, I tried creating a Release Plan with your method and it works for me. However I am creating a new IIterationPlanRecord every time.
It would be interesting to see how the IIterationPlanRecord you are trying to save using the planService looks like. Is it fetched from some origin or newly created? Judging from your original answer there seems to be some plancheck reference that cannot be found. Does this plan come with customized plan views?
Another possibility could be a difference of the client/server services we are using. I am working with the SDK and fetching e.g. my IterationPlanClient from
com.ibm.team.apt.internal.client.*. I am not sure how different it is in the Plain API.
my code posted below. this is an arbitrary plan or arbitrary age, in an arbitrary RTC system (first was 3.01, second is 4.0.1, others to come) end system is 4.0.4
the IIterationPlanClient.class will load as a client lib
the IterationPlanClient.class will not load as a client lib.
so this means there is only 1.
the plan classes are not supplied with the plain java libs.. only in the SDK (as they are not published yet) so, there is only one set.
showing 5 of 8
show 3 more comments
|
Comments
Unfortunately I never tried that. You are in an area that is mostly internal API today.