It's all about the answers!

Ask a question

Creating Iterations using java api

Sudipto Sarkar (631343) | asked May 15 '15, 1:35 a.m.
edited May 15 '15, 3:25 a.m. by Krzysztof Kaźmierczyk (7.4k374103)

 I want to create Iterations using java client library. I saw a post in jazz forum where is it explained.

But my question is do I need to set up a plugin development project for this? Can't I do the same as java project where I will import required jars and create iterations? If yes, Please show me an example.


Accepted answer

permanent link
Tiago Moura (8387) | answered May 15 '15, 12:13 p.m.
Yes, you can only setup a "standalone" enviroment to create iterations on the RTC. You need to download the RTC SDK and use the jars, like you said.

This post explain how to setup you enviroment using Maven:

Sudipto Sarkar selected this answer as the correct answer

Sudipto Sarkar commented May 16 '15, 5:33 a.m.

 It worked. Thanks.

One other answer

permanent link
Sudipto Sarkar (631343) | answered May 19 '15, 12:52 a.m.
If somebody is looking for an live example , here is :
public void createIteration(ITeamRepository repo,
 IProgressMonitor monitor,
            String iterationName, String id, String startDate, String endDate)
            throws TeamRepositoryException {
        IAuditableClient fAuditableClient;
        fAuditableClient = (IAuditableClient) repo

        CreateWI wi = new CreateWI();
        Date start = almDateFormat(startDate);
        Date end = almDateFormat(endDate);
        IProcessItemService service = (IProcessItemService) repo
        List<IProjectArea> activeProjectAreas = new ArrayList();
        List<IProjectArea> allProjectAreas;
        IProjectArea iProjectArea = null;
        allProjectAreas = service.findAllProjectAreas(service.ALL_PROPERTIES,
        Iterator<IProjectArea> iterator = allProjectAreas.iterator();
        while (iterator.hasNext()) {
            iProjectArea =;
            if (CommonString.PROJECT_AREA_NAME.equals(iProjectArea.getName())) {

        IDevelopmentLineHandle developmentLineHandler = iProjectArea
        IDevelopmentLine developmentLine = fAuditableClient.resolveAuditable(
                developmentLineHandler, ItemProfile.DEVELOPMENT_LINE_DEFAULT,

        IIterationHandle[] iterationHandle = developmentLine.getIterations();
        for (int i = 0; i < iterationHandle.length; i++) {
            IIterationHandle iterationList = iterationHandle[i];
            List handle = new ArrayList();
            IFetchResult result = repo.itemManager()
                            IItemManager.REFRESH, monitor);
            IIteration iteration = (IIteration) result.getRetrievedItems().get(
            if (iteration.getName().equals(iterationName)) {
                System.out.println("Iterations already exist. cannot create. Iteration name: "+iteration.getName());
        IIteration newIteration = (IIteration) IIteration.ITEM_TYPE

        IDevelopmentLine workingDevLine = (IDevelopmentLine) developmentLine
        workingDevLine.addIteration((IIterationHandle) newIteration

        newIteration.setDevelopmentLine(workingDevLine); IProcessItem[] { workingDevLine, newIteration },



Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.