Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to create project area programmatically?

Hi,
We would like to create a project area programmatically.
The input parameters we have are project name, 2 member, one spesific role for both members and a project area template.
How should we start?
Thanks

1 vote



2 answers

Permanent link
Hi Baris,

you could have a look at the Team Proces REST API, which allows to create project areas programmatically.

This API is published at https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi#POST_project_areas_collection


I hope this helps,

Regards,

-Nicolas

0 votes


Permanent link

Hi, this might help you out.
          

           if (!TeamPlatform.isStarted()) {
                     TeamPlatform.startup();
               }
           
            String rtcURL = "https:/****.com:9443/rm";
            String user = "**";
            String pass = "*
";

            ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(rtcURL);

            IProgressMonitor MONITOR = new NullProgressMonitor();

            repo.registerLoginHandler(new LoginHandler(user, pass));

            repo.login(MONITOR);
            
            IProcessItemService service = (IProcessItemService) repo.getClientLibrary(IProcessItemService.class);
          
            IProcessDefinition[] definitions = null;

            IProcessDefinition processDefinition = service.findProcessDefinition(processId,
                    IProcessItemService.ALL_PROPERTIES, MONITOR);

            IArtifactTypeManager artifactTypeManager;

            if (processDefinition == null) {
                // Create the definition if it does not exist.
                definitions = service.deployPredefinedProcessDefinitions(new String[] { processId }, MONITOR);
             
                if (definitions.length != 0) {
                    processDefinition = definitions[0];
                } else {
                    throw new TeamRepositoryException("Process template " + processId + " does not exist.");
                }
            }

            if (processDefinition == null) {
                throw new TeamRepositoryException("Could not find Predefined Process " + processId);
            }

            // ---- creation of project area code

            IProjectArea project = service.createProjectArea();

            project.setName(name);
            project.setProcessDefinition(processDefinition);
            project.getDescription().setSummary("Test Process Summary");

            // Save project area that uses the provided process

            service.save(project, MONITOR);

            // --------------- Set project access ------------------
            service.initialize(project, MONITOR);


Thanks
Vab

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943

Question asked: Sep 16 '11, 4:24 a.m.

Question was seen: 5,660 times

Last updated: Apr 04 '17, 5:32 a.m.

Confirmation Cancel Confirm