How to Automatically Create a JIRA Project Using the JIRA CLI
On this page
Recipe overview
This recipe provides step-by-step instructions on how to create a JIRA project and associate existing schemes to it using the JIRA Command Line Utility (CLI) add-on. This allows a JIRA Administrator to quickly, consistently and flawlessly create new projects when requested by your users, especially after you have created your project templates to standardize your organization's use for JIRA.
You will need JIRA Administrator permissions to your JIRA instance in order to complete this recipe.
It will take you approximately 5 minutes to complete this recipe.
Note that this recipe is currently optimized for JIRA 6.4. Stay tuned for another version optimized for JIRA 7.
Recipe level
Ingredients
Preparation
Install the latest downloadable JIRA CLI Client on your computer.
If you have not done so already, follow all of the CLI installation instructions for JIRA including the steps marked optional.
Open a command window you'll use to execute CLI commands.
Steps
Create Example Schemes
Estimated Time: 2 min
In this step, you will be creating a JIRA project using the Create Project wizard. This ensures you have a full set of schemes that can be used later on when creating a new project via the JIRA CLI. In real life, you'd create (or identify a pre-existing) project and schemes on which you want to base future projects. In your JIRA instance, do the following:
| Project values, input on final screen of the Create Project wizard:
Project Summary page: | |||||||||||||||||||||
Create JIRA CLI command
Estimated Time: 2 min
In this step, you will form the command line that will invoke the JIRA CLI to create the project. The command is shown to the right.
Using Default Schemes You may have noticed that the example command line does not contain the --fieldConfiguration, --notificationScheme or --permissionScheme parameters. When any of these are omitted, JIRA CLI associates the new project to the corresponding default scheme. Using the Lookup Parameter If you add the As long as the search finds a single user matching that partial string, that user can be set as the project lead. Otherwise, an error will occur. | Example command: jira --action createProject --project "projectkey" --name "projectname" --lead "joe" --defaultAssignee "UNASSIGNED" --issueTypeScheme "RECIPE: Simple Issue Tracking Issue Type Scheme" --issueTypeScreenScheme "RECIPE: Simple Issue Tracking Issue Type Screen Scheme" --workflowScheme "RECIPE: Simple Issue Tracking Workflow Scheme" | |||||||||||||||||||||
Execute JIRA CLI command
Estimated Time: 1 min
In your command window, type the command from the previous step and press Enter. The command will run, showing the result of executing the createProject action. To inspect the newly created project, click the Cog icon and choose Projects to go into the Project List administration screen. Then click the projectname link in the Name column to view your new project's Summary screen. It should look similar to the screenshot shown to the right. That's it! With one command, you've created a JIRA project and saved yourself from having to complete many steps to do it! | Example output: Project 'projectname' created with key PROJECTKEY and id 10101. Project Summary page: | |||||||||||||||||||||