Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Do you want to migrate tests from other tools? If you are able to export them to a Excel/CSV file, then you may import the tests to JIRA Jira using also CSV using the instructions bellow.

Please do contact us if If you need some guidance on some a specific use case, please contact us.

...


Table of Contents

Import Tests

You can import Test definitions from external sources using CSV files, either by using Xray's Test Case importer (recommended) or JIRAJira's native CSV importer plugin for importing issues (more info on JIRA's article on (see Importing Data from CSV).

This page explaing the later procedure, which is more generic and supports importing of all Test types. However, for manual Tests you should use Xray's Test Case importer.

 


In order to To import issues using JIRAJira's CSV importer, as an administrator, you just have to:

  1. Log in to JIRA Jira as a user with the JIRA Jira Administrators global permission.
  2. Select Administration > System > Import & Export > External System Import > Import button, and then specify the input CSV file.

 You  As a standard user, you can also import issues as a standard user:

  1. Go to the top "Issues" menu.
  2. Select "Import Issues from CSV". 

In the CSV file that you'll use for importing, besides Aside from the native issue columns , like Summary, Description, amongst others Summary and Description, you need to specificy some specify in the CSV file additional columns related with to Xray Test issues:

  • the "Issue Type " column - must be present in your CSV and must contain the name of Xray Test issue type, which is, by default, "Test". Alternately, this column can contain the Test issue type ID.
  • the "Test Type " custom field is - required for each Xray Test Issue. This field can have the following values: Manual, Automated[Cucumber]  or Automated[Generic]

There are some columns that you also need to specify, depending on the type of Test as described in the next sections. 


Info
titleLinks to requirements

Whenever When importing Tests, it's also possible to  you can specify the links to the requirements that each Test validates. For that purpose, the columns must be mapped as Link "Tests".

If the Test covers multiple requirements, then multiple CSV columns must be used, each one being mapped in the same way. 


...


Importing Manual Tests

...


Info
titleRecommended

If you need to import Manual Tests, you should use Xray's Test Case importer instead since it support supports a more user-friendly CSV file layout for describing Test steps.

 

...

Note

 Please be aware that it may be necessary to update JIRA Jira Importers Plugin (JIM) in order to map all custom fields.

Note

 Please be aware that if you If you are importing Tests from a CSV and you are linking your tests to an already existing requirement, you have to Clear the Requirement Status Cache. Please check Importing and Exporting Tests (CSV) for more information about on how to clear the requirement status cache..


In order to import Manual Tests in a CSV file to Jira, you need define the following columns:

  • "Test Type" custom field to is "Manual"
  • "Manual Test Steps" is the custom field with in JSON list format representing all your manual steps. Here is an example for the "Manual Test Steps" custom field: 

...


Code Block
languagehtml/xml
[
    {
        "index": 0,
        "step": "Step 1",
        "data": "input Data 1",
        "result": "Excepted result 1"
    },
    {
        "index": 1,
        "step": "Step 2",
        "data": "input Data 2",
        "result": "Excepted result 2"                      
    },
    {
        "index": 2,
        "step": "Step 3",
        "data": "input Data 3",
        "result": "Excepted result 3"                      
    },
    {
        "index": 3,
        "step": "Step 4",
        "data": "input Data 4",
        "result": "Excepted result 4"                      
    }
]

 

...

]



Code Block
titleExample of CSV file with manual tests
Summary; Assignee; Reporter; Issue Type; Description; Test Type; Manual Test Steps
"Test issue 1"; admin; admin; 10000; "This is a Test issue"; "Manual"; "[ { ""index"": 0, ""step"": ""Step 1"", ""data"": ""input Data 1"", ""result"": ""Excepted result 1"" }, { ""index"": 1, ""step"": ""Step 2"", ""data"": ""input Data 2"", ""result"": ""Excepted result 2"" } ]"
"Test issue 2"; admin; admin; 10000; "This is a Test issue"; "Manual"; "[ { ""index"": 0, ""step"": ""Step 1"", ""data"": ""input Data 1"", ""result"": ""Excepted result 1"" } ]"

 

...



Tip
titleHow to optimize this process

Some organisations organizations already have already Manual Test definitions in spreadsheets. These spreadsheets normally define all Tests to execute and within each Test, their steps. This is the main reason to choosereason why  Xray's Test Case importer as  is a better alternative for importing Manual Tests.

 

Before Xray for JIRA Jira 2.1, you could use a special converter tool (now deprecated) for converting these spreadsheet Test definitions, more specifically the Test Steps, into the JSON format above expected by Xray and JIRAJira.

Importing Cucumber Tests

For Cucumber Test issues, you need to define the following columns in your CSV:

  • "Test Type" to is "Automated[Cucumber]"
  • "Cucumber Test Type" to: is either "Scenario" or "Scenario Outline"
  • "Cucumber Scenario" to is the contents of a Cucumber Scenario.

...

For automated generic Test issues, you need to define the following columns in your CSV:

  • "Test Type" to is "Automated[Generic]"
  • "Generic Test Definition"  to is the test definition.

 


Export Tests

JIRA Jira lets you export your data in CSV or Excel (file is saved as xls but as XLS, but you can open it with your spreadsheet tool and export it to CSV). Xray customfields custom fields are compatible with this function. Even Manual Test Steps field can be exported in a JSON format so that it can be imported back to JIRA Jira directly.


Info
titlePlease note

Since JIRA Jira 7.2, JIRA Jira only provides provided the ability to export issues to CSV in a limited way; recent versions do not support exporting to Excel.

If you need to export issues, including your Tests, to Excel or fully customizable templates, then we recommend using recommend you use the Xporter add-onapp.



 


Once the data is in XLS format, you must remove header headers and footers as those are HTML fields, and then export data as CSV. 

Import Pre-Conditions, Test Sets, Test Executions and Test Plans

Besides Tests, and since Since Xray uses JIRA Jira issue types for its core entities, it's also possible to import other entities such as Pre-Condtions, Test Sets, Test Executions and Test Plans.

Pre-Conditions

It's possible to specifiy You can specify the Tests by using the "Tests association with a Pre-Condition" mapping upon importing. Multiple Tests may be specified by using  Use the comma (",") delimiter to specify multiple tests.

Code Block
titleExample of CSV file with manual tests
Summary; Assignee; Reporter; Issue Type; Type; Condition; Description; Tests associated with Pre Condition
"Standalone PreCondition"; admin; admin; 10; Manual; "calculator must be turned on"; "This is a PreConditon issue";
"PreCondition linked to 2 Tests"; admin; admin; 10; Manual; "calculator must be scientific"; "This is a PreConditon issue"; CALC-779,CALC-756
"PreCondition linked to 1 Test"; admin; admin; 10; Manual; "calculator must be normal"; "This is a PreConditon issue"; CALC-779

Test Sets

It's possible to specifiy You can specify the Tests by using the "Tests associated with Test Set" mapping upon importing. Multiple Tests may be specified by using  Use the comma (",") delimiter to specify multiple tests.

Code Block
titleExample of CSV file with manual tests
Summary; Assignee; Reporter; Issue Type; Description; Tests associated with Test Set
"Test Set without Tests"; admin; admin; 8; "This is a Test Set issue"; 
"Test Set with 2 Tests"; admin; admin; 8; "This is a Test Set issue"; CALC-908,CALC-887

 


Test Executions

It's possible to specifiy You can specify the Tests by using the "Tests association with Test Execution" mapping upon importing. Multiple Tests may be specified by using Use the comma (",") delimiter to specify multiple tests.

Code Block
titleExample of CSV file with manual tests
Fix Version; Summary; Assignee; Reporter; Issue Type; Description; Test Environments; Tests associated with Test Execution
"3.0"; "Test Execution without Tests"; admin; admin; 9; "This is a Test Execution issue";; 
"3.0"; "Test Execution with 2 Tests"; admin; admin; 9; "This is a Test Execution issue"; Android; CALC-908,CALC-887

 


Test Plans

It's possible to specifiy You can specify the Tests by using the "Tests associated with Test Plan" mapping upon importing. Multiple Tests may be specified by using  Use the comma (",") delimiter to specify multiple tests.

Code Block
titleExample
Fix Version; Summary; Assignee; Reporter; Issue Type; Description; Tests associated with Test Plan
"3.0"; "Test Plan without Tests"; admin; admin; 10; "This is a Test Plan issue"; 
"3.0"; "Test Plan with 2 Tests"; admin; admin; 10; "This is a Test Plan issue"; CALC-908,CALC-887

 

 



Copying Tests from one

...

Jira server to another one

Sometimes, you may want to copy Tests specified in some other JIRA Jira server, such as a staging /or testing JIRA environment.

If you need to "migrate" (i.e., copy) the Tests to another JIRA Jira server, you may follow the instructions above for exporting Tests to CSV and to import them from CSV.

The general procedure would be:

  1. In the origin JIRA source Jira server
    1. filter out the the relevant Test issues in the Issues search screen
    2. make visible the columns you want to migrate (don't forget to include the Summary, Issue Type, Test Type, Manual Test Steps and other mandatory fields)
    3. export visible fields to CSV
  2. In the destination JIRA server
    1. import Tests from CSV using JIRAJira's built-in CSV importer (don't forget to map all the mandatory fields)

...

What you will be able to copy:

  • Test-related fields (e.g., summary, labels, etc.)
  • Test Type (mandatory)
  • Manual Test Steps (mandatory for Manual tests)

...

What you won't be able to copy:

  • attachments (global- or step-level attachments)
  • related entities and links (because they won't exist in the destination JIRA Jira server)


Info
titlePlease note

This procedure allows you to migrate the essential of Test 's specificationspecifications. If you need to migrate run's migrate test runs and other information, then this procedure is non-applicable; not applicable. You may use the REST API may be used , but it will require some work from your side since there is no direct way to migrate it.

...


Importing

...

execution-related information from a legacy (non-

...

Jira) test management tool to Xray on

...

Jira

Although Xray allows you to import execution-related information, currently Xray does not currently provide an out-of-the-box solution for migration migrating execution-related information along with respective the corresponding tests from other systems.

...

  1. Migrate Tests specification
    1. From CSV using Test Case Importer; supports attachment   => attachment, but you will miss the mapping information between original_idóidócreated_issue_key; you wil will have to somehow manage it.
    2. Programmatically, create the Test issues using JIRA’s Jira’s REST API (some examples are in http://confluence.xpand-addons.com/display/XRAY/Tests+-+REST#Tests-REST-CreatingandEditingTests-JIRARESTAPI ); this will allow you to easily identify the mapping original_idócreated_issue_key, which can be used afterwards.

 


2. Migrate organization (optional; , not really necessary)

=> This depends greatly on the legacy system organization. If it somehow groups somehow tests, then use the JIRA Jira REST API can be used to create the Test Set issues. After that, Xray’s REST API can be used in order use Xray’s REST API to add the Tests. It is required to You must know the Tests issue keys in advance.

...

a) Create Test Executions with the their respective Tests

 


=> For this, JIRA Use the Jira REST API can be used to create the Test Execution issue. After that, use Xray’s REST API (i.e., POST /rest/raven/1.0/api/testexec/{testExecKey}/test) can be used in order to add the Tests. It is required to know in advance You must know the Tests issue keys in advance.

 


b) Import results for each Test Execution

    • Import just the overall test result, for each test run that is part of the test execution.
    • Import detailed test run results, including per step information


 

...

                =>               Each approach can be achieved using the REST API, and the POST /rest/raven/1.0/import/execution endpoint. You just need to know in advance the Test Execution key  and and also the issues keys for each Test that is part of the Test Execution.

...