How do I create a plan with the Java API?
![]() I tried to write a commandline tool, which creates plans with help of the Java-API. I like to have a csv file which contains a list of plans to create. Each row has Owner, IterationID, Plantype, IncludeAllItems.
There is a Wiki article with an example how to copy plans. So I tried to follow this:
Now I'm stuck, because I get an exception on the save methode:
Error: !ContentStorage.attributeDoesNotMatch!
Has anybody an idea what is wrong? Or has anybody a code-snippet which is working to create plans? I'm running v.3.0.1.3 and 4.0. If it works only for 4.0 it's ok for me.
(I know there are already some very old enhancement requests for supporting this in the API. But all are pre-2.0 and on state triaged, so I thought have a try.)
|
Accepted answer
![]() With help of IBM, we found the issue. In the wiki page and in my code we didn't created the wiki pages for the plan.
My working code looks now like this:
// create necessary plan items
// setup plan values
if (saveResult.isSetIterationPlanRecord() == false) {
Note: this is not a public API. If you like to have a supported API for this, please vote here and write comments on: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=65697
Ralph Schoon selected this answer as the correct answer
Comments ![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Thanks for sharing. Is this interal API not part of the Plain Java Client Libraries (4.0.3, 4.0.4)? Somehow I can't find the needed classes (e.g. IIterationPlanRecord, IIterationPlanService).
This is internal API as mentioned by Bruno. However, dependent on your setup, try to import com.ibm.team.apt.* with * client or common.
I have desribed how I set up my environment here: https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/
I checked the Plain Java Client Libraries. They don't contain the com.ibm.team.apt packages. These are only contained in the SDK. So I would assume it would be necessary to run this kinds of code in a client based on the SDK, e.g. from an Eclipse RTC client.
|
3 other answers
![]()
I think the wiki is outdated.
BTW, I helped Guido in that WI:
That solution is using an internal API (it's not officially supported because it could change and broke your code).
So if you would like an open API to work with Plans, subscribe and comment at WorkItem 65697.
Thanks
|
![]()
The plan is created, but if I try to open it I get an error on the WebUI:
|
Comments
because this field is to short I post an answer below as addendum: