Automating export and import of projects

Automating export and import of projects

Overview

You’ll need version 3.0.0 or higher of Project Configurator. 

3.7.0 Update: Security vulnerabilities fixed in accordance with our bug bounty program. These vulnerabilities affect all prior versions of Project Configurator up to and including 3.6.2. We strongly advise that you upgrade to version 3.7.0 or later. See the 3.7.0 release notes for more information.

This section explains how to drive Project Configurator from the command line so you can create scripts that export or import 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, such as wget or curl. If you are not familiar with wget or curl, it is recommended you first have a look at the manual for these products.

Some examples are provided below. Remember, export and import operations require permission from the system administrator.

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.

Script versions 3.7.0 and newer

Download the following .zip file for our latest script versions for Project Configurator 3.7.0 or later:

These scrips were tested for Linux/Unix and MacOS but not for Windows.


The ZIP file contains the following scripts:

Auxiliary scripts

The auxiliary scripts are required by the Import and Export scripts:

  • wait-task-script 

  • status-checker-script 

  • get-csrf-script

Export script

sh export.sh jira-host-url jira-context-path admin-user admin-password export-file-name export-mode project-key1 project-key2 ... -O export-options
  1. This is an example of an executable script that exports the complete project with key HER:

./export.sh <JIRA_HOST_URL> jira admin admin export.zip -COMPLETE HER
  1. This is an example of an executable script that exports the project configuration of a project with key HER:

./export.sh <JIRA_HOST_URL> jira admin admin export.xml -CONFIG_ONLY HER

Import script

sh import.sh jira-host-url jira-context-path admin-user admin-password import-file-name import-mode [-O import-options ...]
  1. This is an example of an executable script that imports a complete project. For COMPLETE imports, the file must be placed before importing in "projectconfigurator" folder under directory $JIRA_HOME/import.

./import.sh <JIRA_HOST_URL> jira admin admin import.zip -COMPLETE
  1. This is an example of an executable script that imports the project configuration of a project with key HER:

./import.sh <JIRA_HOST_URL> jira admin admin <ABSOLUTE-PATH>/import.xml -CONFIG_ONLY HER

This 3.7.0 script version requires that you update the command used to invoke the import/export scripts. If you are upgrading, refer to the usage command at the top of the related scripts. It is also provided as a snippet below.


Script versions 3.6.2 and older

Download the following .zip file for our earlier script versions for Project Configurator 3.6.2 or older:

 

The ZIP file contains the following scripts:

Auxiliary scripts

The auxiliary scripts are required by the Import and Export scripts:

  • wait-task-script 

  • status-checker-script 

Export script

This is an executable script that exports complete projects. Run the export script using the following command: 

export-project-script jira-host-url jira-context-path admin-user admin-password project-key export-mode [export-file-name] [project-key2 ...] [-O export-options ...]

Import script

This is an executable script that imports complete projects.

import-project-script jira-host-url jira-context-path admin-user admin-password import-file-name import-mode [-O import-options ...]

Legacy import script versions earlier than 3.1.10 

Import script

 

# Usage import-project-script jira-host-url jira-context-path admin-user admin-password import-file-name import-mode [-O import-options ...] RESPONSE_HTML="response.html" COOKIES_FILE="cookies.txt" IMPORT_MODE="" USER=$3 PASSWD=$4 HOST=$1 CONTEXT=$2 BASE_URL="$1/$2" IMPORT_FILE_NAME=$5 if [ "$6" == "-COMPLETE" ] then IMPORT_MODE=" -F "importMode=COMPLETE" -F "projectFile=$IMPORT_FILE_NAME"" SECOND_STEP="secure/complete-project-import.jspa" else IMPORT_MODE=" -F "importMode=CONFIGURATION" -F "projectConfigFile=@$IMPORT_FILE_NAME"" SECOND_STEP="secure/project-config-file-upload!backgroundImport.jspa" fi OPTION_STRING="" shift 6 if [ "$1" == "-O" ] then shift while (( "$#" )) do OPTION_STRING="$OPTION_STRING -F $1" shift done fi echo "options: $OPTION_STRING" curl -u "$USER:$PASSWD" --cookie-jar $COOKIES_FILE "$BASE_URL/secure/Dashboard.jspa?os_authType=basic" --head curl -b $COOKIES_FILE -o $RESPONSE_HTML "$BASE_URL/secure/project-import-type!typeProject.jspa" $IMPORT_MODE if ./status-checker-script $RESPONSE_HTML "-b $COOKIES_FILE -o $RESPONSE_HTML "$BASE_URL/$SECOND_STEP"" $OPTION_STRING" ; then ./wait-task-script $RESPONSE_HTML $HOST $CONTEXT $COOKIES_FILE else echo "Task has stopped" fi

Command 

It is launched with the following command:

import-project-script jira-host-url jira-context-path admin-user admin-password import-file-name import-mode [-O import-options ...]

 


Export options

  • jira-host-url: Host part of the exporting instance base URL, including port if needed (for example, http://my-server:2990)

  • jira-context-path: Context part of the exporting instance base URL (for example, "jira"). Note that jira-host-url + "/" + jira-context-path equals "Jira base URL" (for example, http://my-server:2990/jira)

  • admin-user: Admin’s username

  • admin-password: Admin’s password

  • project-key [project-key2 …​]: Keys of the projects to export, at least one must be provided

  • export-mode: COMPLETE for complete export or CONFIGURATION for exporting just configuration

  • export-file-name: Name of the exported file; the file will be exported in "projectconfigurator" folder under directory $JIRA_HOME/export (for example 'exported-projects-10-04-2025-zip')

  • export-options: Additional export options. Each export option must be specified as key=value, preferably enclosed in double quotes.

Parameters

Possible Values

Notes

Parameters

Possible Values

Notes

attachmentMode

automatic

Attachments will be included in the exported ZIP file (This is the default option)

manual

You’ll need to copy the source Attachments to the target before launching a complete import.

filterUnusedCF

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

Export all custom fields.

filterUnusedCFStrict

Filter custom fields unused by the exported projects, as explained Filtering Unused Custom Fields, 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

The default. Filter custom fields unused by the exported projects, as explained in Filtering Unused Custom Fields.

userExportMode, groupExportMode

fullExport

Export all (users or groups)

ignoreInvalid

The default. 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

global

Export only filters shared with all users

projects

The default. 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

global

Export only dashboards shared with all users

projects

The default. 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

projects

The default. Export only Scrum or Kanban boards associated with the projects being exported. Boards associated with a project appear under the project name in the project navigation panel (see an example image).

all

All Scrum or Kanban boards will be exported

Import options

  • jira-host-url: Host part of the importing instance base URL, including port if needed

  • jira-context-path: Context part of the importing instance base URL

  • admin-user: Admin’s username

  • admin-password: Admin’s password

  • import-file-name: Name of the file to be imported

    • For COMPLETE import - must be placed before importing in "projectconfigurator" folder under directory $JIRA_HOME/import;

    • For CONFIG-ONLY import - the XML file must be placed on the local machine where the scripts are executed. You could pass either the file name or the absolute file path.

  • import-mode: COMPLETE for complete import or CONFIGURATION for importing just configuration

  • import-options: Additional import options. Each import option must be specified as key=value, preferably enclosed in double quotes

Field Name

Valid Values

Mandatory

Defaults to

Field Name

Valid Values

Mandatory

Defaults to

attachmentsPath

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



allowDifferentJiraVersionData

true, false

No

false

applyChanges

true, false

No

false

continueOnDashboardFilterErrors

true, false

No

false

createExtraProjects

true, false

No

false

doNotLoadObjects

Any of the following strings:

  • Versions

  • Components

  • Role members

  • Users

  • Groups

  • Project roles

  • Priorities

  • Resolutions

  • Issue link types

  • Statuses

  • Event types

  • Category

  • Issue types

  • Issue type scheme

  • Custom fields

  • Field configurations

  • Field configuration scheme

  • Screens

  • Screen schemes

  • Issue type screen scheme

  • Workflows

  • Workflow scheme

  • Permission scheme

  • Notification scheme

  • Issue security scheme

  • Filters

  • Dashboards

No Empty. This means loading all object types

publishDrafts (new in v 1.13-JX)

true, false

No

false

smartCFContexts

Temporary files and error handling

These scripts create two temporary files in the same directory where they have been invoked. These files are cookies.txt (it holds the authentication cookie for the session in Jira) and response.html (it keeps the last HTML response received from Jira).

Scripts include a basic level of error handling. If any of the interactions with the server return an error HTML status, the script will stop and display the error status with its intended meaning. The last HTML response (that came with the error HTML status) will be left in the response.html file.


Examples

Export example

export-project-script 10.0.2.2:2990 jira admin admin scriptfile.zip LOREM IPSUM -O "filterCFMode=all" "attachmentMode=automatic" "jiraFilterExportMode=projects" "jiraDashboardExportMode=projects" "agileBoardsExportMode=projects"

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.

 

export-project-script 10.0.2.2:2990 jira admin admin automatescriptfile.zip LOREM IPSUM -O "filterCFMode=exportAllCF" projects param: -F selectedProjectKeys=LOREM -F selectedProjectKeys=IPSUM options: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-AREQUESTID: 859x230x3 Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT X-ASEN: SEN-500 Set-Cookie: JSESSIONID=3FE380E75727D8BA0397C9B42980C69E; Path=/jira/; HttpOnly X-Seraph-LoginReason: OK Set-Cookie: atlassian.xsrf.token=BWP3-NZB2-6EDY-6C7K|a547613084ffb9a2cfa76dca5c55779f17412814|lin; Path=/jira X-ASESSIONID: 1qdqhfg X-AUSERNAME: admin X-Content-Type-Options: nosniff X-Accel-Buffering: no Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 11 Apr 2017 12:19:57 GMT % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 50600 0 50097 100 503 11699 117 0:00:04 0:00:04 --:--:-- 11702 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49844 0 49844 0 0 18396 0 --:--:-- 0:00:02 --:--:-- 18392 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49843 0 49843 0 0 82013 0 --:--:-- --:--:-- --:--:-- 82113 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49843 0 49843 0 0 127k 0 --:--:-- --:--:-- --:--:-- 127k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49843 0 49843 0 0 116k 0 --:--:-- --:--:-- --:--:-- 116k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49843 0 49843 0 0 87391 0 --:--:-- --:--:-- --:--:-- 87443 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49843 0 49843 0 0 78113 0 --:--:-- --:--:-- --:--:-- 78246 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49844 0 49844 0 0 102k 0 --:--:-- --:--:-- --:--:-- 102k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49879 0 49879 0 0 54246 0 --:--:-- --:--:-- --:--:-- 54216 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49879 0 49879 0 0 145k 0 --:--:-- --:--:-- --:--:-- 145k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49866 0 49866 0 0 72476 0 --:--:-- --:--:-- --:--:-- 72479 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49866 0 49866 0 0 61805 0 --:--:-- --:--:-- --:--:-- 61791 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49866 0 49866 0 0 224k 0 --:--:-- --:--:-- --:--:-- 225k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 82899 0 --:--:-- --:--:-- --:--:-- 82817 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 173k 0 --:--:-- --:--:-- --:--:-- 173k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 306k 0 --:--:-- --:--:-- --:--:-- 308k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49857 0 49857 0 0 37096 0 --:--:-- 0:00:01 --:--:-- 37123 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 69682 0 --:--:-- --:--:-- --:--:-- 69728 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49857 0 49857 0 0 56433 0 --:--:-- --:--:-- --:--:-- 56399 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 161k 0 --:--:-- --:--:-- --:--:-- 161k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 583k 0 --:--:-- --:--:-- --:--:-- 586k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 141k 0 --:--:-- --:--:-- --:--:-- 141k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 221k 0 --:--:-- --:--:-- --:--:-- 222k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 242k 0 --:--:-- --:--:-- --:--:-- 242k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 56313 0 --:--:-- --:--:-- --:--:-- 56270 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 95634 0 --:--:-- --:--:-- --:--:-- 95692 Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49856 0 49856 0 0 302k 0 --:--:-- --:--:-- --:--:-- 304k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10100 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49427 0 49427 0 0 45959 0 --:--:-- 0:00:01 --:--:-- 45978 Destination URL 10.0.2.2:2990 Task has finished

Import example

import-project-script 10.0.2.2:2990 jira admin admin scriptfile.zip -COMPLETE -O "applyChanges=true" "createExtraProjects=true" "smartCFContexts=false" "publishdrafts=true" "continueOnDashboardFilterErrors=true" "attachmentsPath="

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.

 

import-project-script 10.0.2.2:2990 jira admin admin automatescriptfile.zip options: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-AREQUESTID: 863x537x1 Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT X-ASEN: SEN-500 Set-Cookie: JSESSIONID=7167238DC067766192AA8E89EC37D97F; Path=/jira/; HttpOnly X-Seraph-LoginReason: OK Set-Cookie: atlassian.xsrf.token=BWP3-NZB2-6EDY-6C7K|842e3643cd6b103f4c5bc9a41158a1349cbf14b9|lin; Path=/jira X-ASESSIONID: 4annn0 X-AUSERNAME: admin X-Content-Type-Options: nosniff X-Accel-Buffering: no Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 11 Apr 2017 12:23:50 GMT % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49139 0 48971 100 168 15973 54 0:00:03 0:00:03 --:--:-- 15977 Destination URL 10.0.2.2:2990/jira/secure/preprocessor-step-result.jspa?taskId=10104 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48697 0 48697 0 0 7845 0 --:--:-- 0:00:06 --:--:-- 12165 Destination URL 10.0.2.2:2990/jira/secure/preprocessor-step-result.jspa?taskId=10104 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48716 0 48716 0 0 79320 0 --:--:-- --:--:-- --:--:-- 79213 Destination URL 10.0.2.2:2990/jira/secure/preprocessor-step-result.jspa?taskId=10104 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48716 0 48716 0 0 592k 0 --:--:-- --:--:-- --:--:-- 594k Destination URL 10.0.2.2:2990/jira/secure/preprocessor-step-result.jspa?taskId=10104 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48716 0 48716 0 0 109k 0 --:--:-- --:--:-- --:--:-- 109k Destination URL 10.0.2.2:2990/jira/secure/preprocessor-step-result.jspa?taskId=10104 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 49154 0 49154 0 0 11742 0 --:--:-- 0:00:04 --:--:-- 16467 Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 49173 0 49173 0 0 16970 0 --:--:-- 0:00:02 --:--:-- 16967 Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48667 0 48667 0 0 156k 0 --:--:-- --:--:-- --:--:-- 156k Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48668 0 48668 0 0 66442 0 --:--:-- --:--:-- --:--:-- 66486 Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48667 0 48667 0 0 123k 0 --:--:-- --:--:-- --:--:-- 123k Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48667 0 48667 0 0 345k 0 --:--:-- --:--:-- --:--:-- 346k Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48663 0 48663 0 0 72545 0 --:--:-- --:--:-- --:--:-- 72523 Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48664 0 48664 0 0 74098 0 --:--:-- --:--:-- --:--:-- 74182 Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48664 0 48664 0 0 167k 0 --:--:-- --:--:-- --:--:-- 168k Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48664 0 48664 0 0 212k 0 --:--:-- --:--:-- --:--:-- 213k Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48671 0 48671 0 0 32900 0 --:--:-- 0:00:01 --:--:-- 32885 Destination URL 10.0.2.2:2990/jira/secure/RealConfigStepResult.jspa?taskId=10105 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 48736 0 48736 0 0 10953 0 --:--:-- 0:00:04 --:--:-- 11472 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48735 0 48735 0 0 14553 0 --:--:-- 0:00:03 --:--:-- 14552 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48734 0 48734 0 0 33427 0 --:--:-- 0:00:01 --:--:-- 33425 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48733 0 48733 0 0 8512 0 --:--:-- 0:00:05 --:--:-- 13832 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48732 0 48732 0 0 47855 0 --:--:-- 0:00:01 --:--:-- 47870 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48731 0 48731 0 0 36090 0 --:--:-- 0:00:01 --:--:-- 36097 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48731 0 48731 0 0 78667 0 --:--:-- --:--:-- --:--:-- 78725 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48733 0 48733 0 0 46363 0 --:--:-- 0:00:01 --:--:-- 46412 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48732 0 48732 0 0 50485 0 --:--:-- --:--:-- --:--:-- 50499 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48732 0 48732 0 0 47041 0 --:--:-- 0:00:01 --:--:-- 47084 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48729 0 48729 0 0 64234 0 --:--:-- --:--:-- --:--:-- 64286 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48743 0 48743 0 0 58835 0 --:--:-- --:--:-- --:--:-- 58797 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48734 0 48734 0 0 229k 0 --:--:-- --:--:-- --:--:-- 229k Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48736 0 48736 0 0 9250 0 --:--:-- 0:00:05 --:--:-- 11986 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48731 0 48731 0 0 69950 0 --:--:-- --:--:-- --:--:-- 70015 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48731 0 48731 0 0 80039 0 --:--:-- --:--:-- --:--:-- 80018 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48733 0 48733 0 0 32022 0 --:--:-- 0:00:01 --:--:-- 32019 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48732 0 48732 0 0 39439 0 --:--:-- 0:00:01 --:--:-- 39459 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48733 0 48733 0 0 45665 0 --:--:-- 0:00:01 --:--:-- 45672 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48729 0 48729 0 0 37192 0 --:--:-- 0:00:01 --:--:-- 37169 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48983 0 48983 0 0 49285 0 --:--:-- --:--:-- --:--:-- 49278 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48996 0 48996 0 0 45996 0 --:--:-- 0:00:01 --:--:-- 46005 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48743 0 48743 0 0 99629 0 --:--:-- --:--:-- --:--:-- 99475 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 48745 0 48745 0 0 37123 0 --:--:-- 0:00:01 --:--:-- 37124 Destination URL 10.0.2.2:2990/jira/secure/DataImportStepResult.jspa?taskId=10106 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 54111 0 54111 0 0 22398 0 --:--:-- 0:00:02 --:--:-- 22396 Destination URL 10.0.2.2:2990 Task has finished

Error handling

Let’s look at a couple of examples of error traces and how to fix those errors.

 

export-project-script 10.0.2.2:2990 jira admin admin scriptfile.zip SCRUM -O "agileBoardsExportMode=all" projects param: -F selectedProjectKeys=SCRUM options: -F agileBoardsExportMode=all HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-AREQUESTID: 844x6048x1 Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: JSESSIONID=A62379852B3DEFC5466B5DC53264E467; Path=/jira/; HttpOnly X-Seraph-LoginReason: OK Set-Cookie: atlassian.xsrf.token=B74A-S9EF-8DS8-KK7L|d6c953f80429e43ab3ff75583a59401d0ae64c5b|lin; Path=/jira X-ASESSIONID: 1e9uxb0 X-AUSERNAME: admin X-Content-Type-Options: nosniff X-Accel-Buffering: no Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 11 Apr 2017 12:04:43 GMT % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 93679 0 93184 100 495 1033k 5619 --:--:-- --:--:-- --:--:-- 1045k Destination URL 10.0.2.2:2990/jira/secure/project-export-result.jspa?taskId=10307 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 94225 0 94225 0 0 1670k 0 --:--:-- --:--:-- --:--:-- 1704k Something went wrong, http status: 500 Error in export, please check response.html Task has finished

Here, the trace ended with an http status: 500, and it states that we should check the response.html.

In the response.html, we see the following:

 

java.lang.NoSuchFieldError: NONE at com.awnaba.projectconfigurator.projectconfigserialize.JSBoardsGlobalTable.dumpCardColors(JSBoardsGlobalTable.java:147) at com.awnaba.projectconfigurator.projectconfigserialize.JSBoardsGlobalTable.insert(JSBoardsGlobalTable.java:113) at com.awnaba.projectconfigurator.projectconfigserialize.JSBoardsGlobalTable.insert(JSBoardsGlobalTable.java:55) at com.awnaba.projectconfigurator.projectconfigserialize.AbstractGlobalTable$1.doAndReturn(AbstractGlobalTable.java:27) at com.awnaba.projectconfigurator.utils.SmartErrorReporter.wrapSafely(SmartErrorReporter.java:84) at com.awnaba.projectconfigurator.projectconfigserialize.AbstractGlobalTable.findOrInsertObject(AbstractGlobalTable.java:23) at com.awnaba.projectconfigurator.projectconfigserialize.ExportManager.dumpAgileBoards(ExportManager.java:305) at com.awnaba.projectconfigurator.projectconfigserialize.ExportManager.createJAXBTree(ExportManager.java:139) at com.awnaba.projectconfigurator.projectconfigserialize.ExportManager.dumpConfigurations(ExportManager.java:98) at com.awnaba.projectconfigurator.operationsapi.impl.ProjectConfigExporterImpl.doExport(ProjectConfigExporterImpl.java:96) at com.awnaba.projectconfigurator.operationsapi.impl.ProjectConfigExporterImpl.callExport(ProjectConfigExporterImpl.java:78) at com.awnaba.projectconfigurator.operationsapi.impl.ProjectConfigExporterImpl.exportSynchronous(ProjectConfigExporterImpl.java:136) at com.awnaba.projectconfigurator.transporter.engine.FullExportManager.exportConfig(FullExportManager.java:191) at com.awnaba.projectconfigurator.transporter.engine.FullExportManager.call(FullExportManager.java:67) at com.awnaba.projectconfigurator.transporter.engine.FullExportManager.call(FullExportManager.java:34) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:528) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:254) at java.lang.Thread.run(Thread.java:745)

In this example, something in Project Configurator failed. After searching PCP’s wiki or contacting support, we find this error occurred 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.

 

import-project-script 10.0.2.2:2990 jira admin admin wrongfile options: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-AREQUESTID: 849x6051x1 Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: JSESSIONID=0761B3D4DDF6416BE52C4E310D5DD671; Path=/jira/; HttpOnly X-Seraph-LoginReason: OK Set-Cookie: atlassian.xsrf.token=B74A-S9EF-8DS8-KK7L|e15eb9d34e71b17d894875a1999d50eaca79c6a7|lin; Path=/jira X-ASESSIONID: oyjtjj X-AUSERNAME: admin X-Content-Type-Options: nosniff X-Accel-Buffering: no Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 11 Apr 2017 12:09:58 GMT % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 98971 0 98816 100 155 487k 782 --:--:-- --:--:-- --:--:-- 489k Something went wrong, http status: 400 Error in load, please check response.html Task has stopped

This trace ended with an HTTP status: 400. In response.html, we find the following:

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.

This means the file name was wrong, it doesn’t exist, or it may be missing its extension.