It's all about the answers!

Ask a question

commands to create project area from command line interface


Kaipa Sudheernath Reddy (1128) | asked Oct 29 '15, 9:53 a.m.
I want to create a project area,through command line.If there is any commands to do that,please let me know,I would appreciate your responses.

Thank you

3 answers



permanent link
K M (38325251) | answered Nov 02 '15, 9:33 a.m.
I use this to create a project, using the java api

    /**
     * Create Project
     * @param name Project Name
     * @param processId Process Template Name
     * @return Status Message
     * @throws TeamRepositoryException
     */
    public String createProject(String name, String processId) throws TeamRepositoryException{
        String msg = "Created project " + name + " with process id Name " + processId;           

        IProcessItemService service = (IProcessItemService)repo.getClientLibrary(IProcessItemService.class);
        IProcessDefinition definition = service.findProcessDefinition(processId,IProcessItemService.ALL_PROPERTIES, MONITOR);
        if (definition == null) {
            throw new TeamRepositoryException("Could not find Predefined Process " + processId);           
        }
        IProjectArea project = service.createProjectArea();
        project.setName(name);
        project.setProcessDefinition(definition);       
        service.save(project, MONITOR);

        // Set project access
        setVisibility(name,false,false,true);

        service.initialize(project, MONITOR);

        return msg;
    }


permanent link
Chris McGee (50511117) | answered Nov 03 '15, 2:35 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
There is an open source project on IBM DevOps Services that may suit your needs. It's unsupported and use at your own risk.

https://hub.jazz.net/project/cbmcgee/projectcreator/overview

Download the latest pre-built binary here:

https://hub.jazz.net/ccm09/web/projects/cbmcgee%20|%20projectcreator#action=com.ibm.team.build.viewResult&id=_bERTgXToEeWjQcb10W694w&tab=com.ibm.team.build.web.ui.internal.editors.result.download.DownloadsProvider

permanent link
Ralph Schoon (63.5k33646) | answered Oct 29 '15, 11:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There is no command line shipped with the products which would allow to do this. This would be custom automation you have to write and maintain yourself.

For RTC, you can find samle code to do this in the Plain Java Client Library snippets or in the post https://rsjazz.wordpress.com/2013/09/18/deploying-templates-and-creating-projects-using-the-plain-java-clients-library/ . Not sure if that would work with the other products. I know others have created automation like that. Maybe they can share.

 

Comments
Kaipa Sudheernath Reddy commented Nov 02 '15, 7:14 a.m. | edited Nov 02 '15, 7:18 a.m.

Hai Ralph,
Can you refer someone to me,who can share their code.


Ralph Schoon commented Nov 02 '15, 7:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No, I don't have specific names. I can only share the code on my blog.

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.