It's all about the answers!

Ask a question

Java Code for creating PLAN in RTC?

Neha Malviya (623) | asked Dec 11 '14, 6:52 a.m.
 Can anyone provide some working code to create a plan in RTC using Java APIs? 

2 answers

permanent link
Neha Malviya (623) | answered Dec 12 '14, 3:40 a.m.
The code is not working for me . Idont have the supported APIs for IWikiPage , IIterationPlanRecord ,IIterationPlanService .

Can someone else provide me some other working code?

sam detweiler commented Dec 12 '14, 7:29 a.m.

you have to download the SDK pakage and use the apt jar files from there as well. the apt jars contain the planning apis. which are not published.

sam detweiler commented Dec 12 '14, 9:15 a.m.

you didn't say what release, so I picked 4.0.7, here is the download page,

select the 'Source Code', download, unzip, and in the plugins folder you will find the jars for the planning apis.

this list is from my 4.0.1 sdk download
 Directory of J:\temp\rtc 4.0.1 gm\RTC-SDK\plugins

11/14/2012  01:44 AM           123,213
11/14/2012  01:44 AM            25,985
11/14/2012  01:40 AM            52,087

permanent link
sam detweiler (12.5k6194201) | answered Dec 11 '14, 8:22 a.m.
here is a routine in one of my programs. note that you must use the *.apt.* jar files from the sdk plugins
this is derived from Guido's code in

    private static void createPlan(IAuditableClient destauditableClient,
            IProjectArea project, String planName,
            IIterationHandle planIteration, String planType,
            IItemHandle planTeam, String planinfo, IContributor creator)
        // get classes for plan creation
        IAuditableCommon audit = (IAuditableCommon) destauditableClient.getTeamRepository().getClientLibrary(IAuditableCommon.class);
        IIterationPlanService planService = (IIterationPlanService) ((IClientLibraryContext) destauditableClient.getTeamRepository()).getServiceInterface(IIterationPlanService.class);

        // create necessary plan items
        IIterationPlanRecord plan = (IIterationPlanRecord) IIterationPlanRecord.ITEM_TYPE.createItem();

        IWikiPage wiki = (IWikiPage) IWikiPage.ITEM_TYPE.createItem();

        // setup plan values
        plan.setOwner((IProcessAreaHandle) planTeam);

        // setup wiki page
        wiki.setName("entry " + planName);

        String encoding = "UTF8";
        String xmlText = "<p>test</p>";
        byte[] bytes;
            InputStream inputStream = null;
            if (planinfo != null)
                bytes = planinfo.getBytes(encoding);

                inputStream = new ByteArrayInputStream(bytes);

                plan.setAuxiliaryData(audit.storeContent(IContent.CONTENT_TYPE_TEXT, encoding, inputStream, bytes.length, null));

            bytes = xmlText.getBytes(encoding);

            inputStream = new ByteArrayInputStream(bytes);

            wiki.setContent(audit.storeContent(IContent.CONTENT_TYPE_TEXT, encoding, inputStream, bytes.length, null));
            // save plan
            DTO_IterationPlanSaveResult saveResult =, plan, wiki);
            if (saveResult.isSetIterationPlanRecord() == false)
                System.out.println("Saving failed!");
        catch (Exception e)


sam detweiler commented Dec 11 '14, 9:05 a.m.

plan type id strings are here

Your answer

Register or to post your answer.