commands to create project area from command line interface
3 answers
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;
}
/**
* 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;
}
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
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
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.
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.