You'll need version 2.1.3 or higher of Project Configurator.
This section explains how to drive Project Configurator from the command line, so that you can create scripts that export or load complete projects. The method is based on interacting with the Jira server by issuing http requests to concrete URLs. You need a tool that lets you issue http requests from the command line, as wget or curl. If you are not familiar with wget or curl, it is recommended you have a look first at the manual for these products.
Some examples are provided. Remember that the export and load operations require a user with system administrator permission.
These examples have been tested on Ubuntu Linux 16.04 and they use curl and xmllint. Both programs must be installed on the system where you are going to run the scripts, you can install them with the following commands:
apt get update
apt get install curl
apt get install libxml2-utils
In order to execute the scripts provided, copy them to a folder included in your machine's path for executable files and make them executable.
The export and import scripts will need the following scripts to work:
This is an executable script that exports complete projects.
It is launched with the following command:
Attachments will be included in the exported ZIP file (This is the default option)
You'll need to copy the source Attachments in the target before launching a complete import.
|true||This parameter is deprecated. It is kept for backward compatibility with versions 1.3.0 and earlier of the app. It is equivalent to setting "filterCFMode=filterUnusedCFStrict".|
|filterCFMode||exportAllCF||The default, if no value is supplied for this parameter. Export all custom fields.|
|filterUnusedCFStrict||Filter custom fields unused by the exported projects, as explained here but without taking into account whether there are issues in the project with values for that custom field. This option is deprecated, it is kept only for backwards compatibility with app versions older than 1.5.|
|filterUnusedCFExtended||Filter custom fields unused by the exported projects, as explained here.|
|userExportMode, groupExportMode||fullExport||Export all (users or groups)|
|ignoreInvalid||Export all but users or groups not found or not valid|
|doNotExport||No user or group will be exported.|
|jiraFilterExportMode||none||No filter will be exported (This is the default option, if nothing is specified)|
|global||Export only filters shared with all users|
|projects||Export only filters shared with projects being exported|
|global-or-projects||Combines two previous options: export filters that are shared globally or with exported projects.|
|shared||Export only filters that the owner has shared with somebody else|
|all||All filters (either private or shared) will be exported|
|jiraDashboardExportMode||none||No dashboard will be exported (This is the default option, if nothing is specified)|
|global||Export only dashboards shared with all users|
|projects||Export only dashboards shared with projects being exported|
|global-or-projects||Combines two previous options: export dashboards that are shared globally or with exported projects.|
|shared||Export only dashboards that the owner has shared with somebody else|
|all||All dashboards (either private or shared) will be exported|
|agileBoardsExportMode||none||No Scrum or Kanban board will be exported (This is the default option, if nothing is specified)|
|projects||Export only Scrum or Kanban boards associated to the projects being exported. Boards associated to a project appear under the project name at the project navigation panel.|
|all||All Scrum or Kanban boards will be exported|
This is an executable script that imports complete projects.
It is launched with the following command:
jira-host-url: Host part of the importing instance base URL, including port if needed.
A directory path with project attachments
If you selected to move Attachments manually, introduce the Attachments path where you copied them
|Yes (for complete imports)|
|projectConfigFile||A file with a valid project configuration||Yes|
Any of the following strings:
Issue link types
Issue type scheme
Field configuration scheme
Issue type screen scheme
Issue security scheme
|No||Empty. This means to load all object types|
|publishDrafts (new in v 1.13-JX)||true, false||No||false|
Take into account that...
We're exporting the projects LOREM and IPSUM from the Jira server located in 10.0.2.2:2990 into a file called scriptfile.zip, using the account admin:admin.
We're importing the projects LOREM and IPSUM from a file called scriptfile.zip into the server located in 10.0.2.2:2990, using the account admin:admin.
Let's see a couple examples of error traces, and how to fix those errors.
As we can see, the trace ended with an http status: 500, and it says that we should check response.html.
Inside response.html, we can find:
As we can see, something in Project Configurator failed. After searching in PCP's wiki or contacting support, we find that this error happens because we tried to export a project with agile boards from a Jira instance with Jira Agile v6.7.6, and Project Configurator is only compatible with Jira Agile v6.7.7 or higher.
This trace ended with an http status: 400, again, we check response.html to see what happened.
In response.html, we find:
An error occurred:
File C:\Atlassian_tutorial\myPlugin\target\jira\home\import\projectconfigurator\wrongfile does not exist or Jira does not have permissions to open and read it.
Which means the filename was wrong, it doesn't exist or it may be missing its extension.