---
title: "Exporting Test"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/44574749/Exporting%20Test"
format: markdown
---
<details>
<summary>Table of Contents</summary>

> Macro (toc)
</details>

# Introduction

From a [**Test**](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565156), it's possible to export the following Xray data: [**Preconditions**](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565159)**, **[**Test Sets**](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565163)**, **[**Test Plans**](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565153)**, **[**Test Executions**](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565117)**, Test Versions, **and** **[**Test Runs**](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565109)**.**

In addition to the usual Jira mappings, you can export the following fields:

- *Cucumber Scenario*
- *Generic Test Definition*
- *TestType*
- *TestStatus*
- *TestStepsCount*
- *TestsCount*
- *TestRepositoryPath*


##### **Some mappings you can export from a Test**

```
Key: ${Key}
Cucumber Scenario: ${Cucumber Scenario}
Generic Test Definition: ${Generic Test Definition}
Test Type: ${TestType}
Test Status: ${TestStatus}
Test Steps Total: ${TestStepsCount}
Tests Count: ${TestsCount}
Test Repository Path: ${TestRepositoryPath}
```

# Exporting Data

## Exporting Test Steps from a Test

For each [Test Step](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565316), you can export the following fields:

- *Action*
- *AttachmentsCount*
- *Data*
- *ExpectedResult*
- *StepNumber*
- *New created Test Steps Fields*

Below is an example of how to iterate over the list of **Test Steps** associated with a **Test.**

##### **Iterate over Test Steps**

```
Total number of associated test steps: ${TestStepsCount}

// Iterating each test step
#{for teststeps}
	 Action: ${TestSteps[n].Action}
     Data: ${TestSteps[n].Data}
     Expected Result: ${TestSteps[n].ExpectedResult}
     Step Number: ${TestSteps[n].StepNumber}
	 // Replace the placeholder text to export any newly created test step field
	 Test Step Field:${Tests[n].<Test Step Field>}
     // Iterating over attachments for each test step
     #{for l=TestSteps[n].AttachmentsCount}
     	Id: ${TestSteps[n].Attachments[l].Id}
        Name: ${TestSteps[n].Attachments[l].Name}
        Image: ${TestSteps[n].Attachments[l].Attachment}
        FileURL: ${TestSteps[n].Attachments[l].FileURL}
     #{end}
#{end}
 
or
 
// Iterating each test step
#{for j=TestStepsCount}
	Action: ${TestSteps[j].Action}
    Data: ${TestSteps[j].Data}
	Expected Result: ${TestSteps[j].ExpectedResult}
    Step Number: ${TestSteps[j].StepNumber}
	// Replace the placeholder text to export any newly created test step field
	Test Step Field:${Tests[n].TestSteps[m].<Test Step Field>}
    // Iterating over attachments for each test step
    #{for l=TestSteps[j].AttachmentsCount}
		Id: ${TestSteps[j].Attachments[l].Id}
        Name: ${TestSteps[j].Attachments[l].Name}
		Image: ${TestSteps[n].Attachments[l].Attachment}
		FileURL: ${TestSteps[n].Attachments[l].FileURL}
    #{end}
#{end}
```

### Exporting Modular Test Steps from a Test

For each Modular Test Step you can export the following fields:

- *IsCalledTest* (which will be true if the Step is a called Test; false if it's a normal Step).
- *IsDeletedCalledTest* (which will indicate if the called Step Issue was deleted).
- *IsInvalidIssueTypeCalledTest* (which will indicate if the called Step Issue type has changed).
- *CalledTestParameters* (the called Test Dataset Parameters in JSON format).
- *CalledTest.Field *(The issue called. You can export all the data from a Test)

Below is an example of how to iterate over the list of **Modular Test Steps** associated with a **Test.**

##### **Iterate over Test Steps**

```
Total number of associated test steps: ${TestStepsCount}

// Iterating each test step
#{for teststeps}	#{if (%{${TestSteps[n].IsCalledTest}})}
        #{if (%{${TestSteps[n].IsDeletedCalledTest}})}
            Called test issue not found.
        #{end}
        #{if (%{${TestSteps[n].IsInvalidIssueTypeCalledTest}})}
            Called test issue type is invalid.
        #{end}
        #{if (%{!${TestSteps[n].IsDeletedCalledTest} && !${TestSteps[n].IsInvalidIssueTypeCalledTest}})}
            ${TestSteps[n].CalledTestParameters}
            ${TestSteps[n].CalledTest.Key}
            ${TestSteps[n].CalledTest.Summary}
        #{end}
    #{end}
#{end}
```

### Exporting Modular Test Steps Parameters from a Test

<span style="color: #172B4D">You can iterate over the Test Call Parameters:</span>

##### **Iterate over Test Steps**

```
Total number of associated test steps: ${TestStepsCount}

// Iterating each test step
#{for teststeps}
    #{if (%{${TestSteps[n].IsCalledTest}})}
        #{for p=TestSteps[n].CalledTestParametersCount}
            ${TestSteps[n].CalledTestParameters[p].Name}
            ${TestSteps[n].CalledTestParameters[p].Value}
        #{end}
    #{end}
#{end}
```

## Exporting Preconditions from a Test

Below is an example of how to iterate over the list of **Preconditions** associated with a **Test.**

##### **Iterate over preconditions**

```
Total number of associated preconditions: ${PreConditionsCount}

// Iterating each precondition
#{for preconditions}
	Key: ${PreConditions[n].Key}
	Type: ${PreConditions[n].PreCondition.Type}
	Definition: ${PreConditions[n].PreCondition.Definition}
#{end}
 
or
 
// Iterating each precondition
#{for j=PreConditionsCount}
	Summary: ${PreConditions[j].Summary}
	Type: ${PreConditions[j].PreCondition.Type}
	Definition: ${PreConditions[j].PreCondition.Definition}
#{end}
```

> ℹ️ Go [here](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565159) to see more detailed information on how to export Preconditions.

## Exporting Test Sets from a Test

Below is an example of how to iterate over the list of **Test Sets** associated with a **Test.**

##### **Iterate over Test Sets**

```
Total number of associated test sets: ${TestSetsCount}

// Iterating each test set
#{for testSets}
	Description: ${TestSets[n].Description}
#{end}
 
or
 
// Iterating each test set
#{for j=TestSetsCount}
	Summary: ${TestSets[j].Summary}
#{end}
```

> ℹ️ Go here to see more detailed information on how to export [Test Sets](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44574755).

## Exporting Test Plans from a Test

Below is an example of how to iterate over the list of **Test Plans** associated with a **Test.**

##### **Iterate over Test Plans**

```
Total number of associated test plans: ${TestPlansCount}

// Iterating each test plan
#{for testPlans}
	Summary: ${TestPlans[n].Summary}
#{end}
 
or
 
// Iterating each test plan
#{for j=TestPlansCount}
	Description: ${TestPlans[j].Description}
#{end}
```

> ℹ️ Go [here](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44574751) to see more detailed information on how to export Test Plans.

## Exporting Test Executions from a Test

Below is an example of how to iterate over the list of **Test Executions** associated with a **Test.**

##### **Iterate over Test Executions**

```
Total number of associated test executions: ${TestExecutionsCount}

// Iterating each test execution
#{for testExecutions}
	Key: ${TestExecutions[n].Key}
	Test Environments: ${TestExecutions[n].TestEnvironments}
#{end}
 
or
 
// Iterating each test execution
#{for j=TestExecutionsCount}
	Summary: ${TestExecutions[j].Summary}
	Test Environments: ${TestExecutions[j].TestEnvironments}
#{end}
```

> ℹ️ Go [here](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565732) to see more detailed information on how to export Test Executions.

## Exporting Test Runs from a Test

Below is an example of how to iterate over the list of **Test Runs** associated with a **Test.**

Test Runs also contain information relative to the Test Run's specific Test version.

##### **Iterate over Test Runs**

```
Total number of associated test runs: ${TestRunsCount}

// Iterating each test run
#{for testruns}
    Assignee Id: ${TestRuns[n].AssigneeId}
    Key: ${TestRuns[n].Key}
    Summary: ${TestRuns[n].Summary}
    Comment: ${TestRuns[n].Comment}
    Generic Test Definition: ${TestRuns[n].Generic Test Definition}
    Cucumber Scenario: ${TestRuns[n].Cucumber Scenario}
    Executed by: ${TestRuns[n].Executed By}
    Execution Status: ${TestRuns[n].Execution Status}
    Started on: ${TestRuns[n].Started On}
    Finished on: ${TestRuns[n].Finished On}
	Test Version Name: ${TestRuns[n].TestVersion.Name} 
    Test Version Id: ${TestRuns[n].TestVersion.Id}
    Test Version Number: ${TestRuns[n].TestVersion.Number}
    Test Version Created: ${TestRuns[n].TestVersion.Created}
    Test Version Updated: ${TestRuns[n].TestVersion.Updated}
    Test Version Author: ${TestRuns[n].TestVersion.Author}
    Test Version Author Id: ${TestRuns[n].TestVersion.AuthorId}
    Test Version Author Email Address: ${TestRuns[n].TestVersion.AuthorEmailAddress}    
    Test Version Is Default: ${TestRuns[n].TestVersion.IsDefault}
    Test Version Is Archived: ${TestRuns[n].TestVersion.IsArchived}

	// Replace the placeholder text to export any custom field associated with the test run.
	Test Run Custom Field:${TestRuns[n].<Test Run Custom Field>}

    // Iterating over execution evidences for each test run
    Execution Evidences Total: ${TestRuns[n].ExecutionEvidencesCount}
    #{for m=TestRuns[n].ExecutionEvidencesCount}
        Id: ${TestRuns[n].ExecutionEvidences[m].Id}
        Name: ${TestRuns[n].ExecutionEvidences[m].Name}
		File URL: ${TestRuns[n].ExecutionEvidences[m].FileURL}
		Evidence: ${TestRuns[n].ExecutionEvidences[m].Evidence}
    #{end}

    // Iterating over execution defects for each test run
    Execution Defects Total: ${TestRuns[n].ExecutionDefectsCount}
    #{for m=TestRuns[n].ExecutionDefectsCount}
        Id: ${TestRuns[n].ExecutionDefects[m].Id}
        Description: ${TestRuns[n].ExecutionDefects[m].Description}
        Key: ${TestRuns[n].ExecutionDefects[m].Key}
        Summary: ${TestRuns[n].ExecutionDefects[m].Summary}
    #{end}

	// Iterating over parameters for each test run
    Parameters Total: ${TestRuns[n].ParametersCount}
	#{for m=TestRuns[n].ParametersCount}
        Key: ${TestRuns[n].Parameters[m].Key}
        Value: ${TestRuns[n].Parameters[m].Value}
    #{end}

	// Iterating over preconditions for each test run
    Preconditions Total: ${TestRuns[n].PreConditionsCount}
    #{for m=TestRuns[n].PreConditionsCount}
        Definition: ${TestRuns[n].PreConditions[m].PreCondition.Definition}
        Type: ${TestRuns[n].PreConditions[m].PreCondition.Type}
    #{end}

    // Iterating over test steps for each test run
    Test Steps Total: ${TestRuns[n].TestStepsCount}
    #{for m=TestRuns[n].TestStepsCount}
        Action: ${TestRuns[n].TestSteps[m].Action}
        Comment: ${TestRuns[n].TestSteps[m].Comment}
        Data: ${TestRuns[n].TestSteps[m].Data}
        Expected Result: ${TestRuns[n].TestSteps[m].ExpectedResult}
		Actual Result: ${TestRuns[n].TestSteps[m].ActualResult}
        Status: ${TestRuns[n].TestSteps[m].Status}
        Step Number: ${TestRuns[n].TestSteps[m].StepNumber}
		// Replace the placeholder text to export any custom field associated with the test step.
		Step Custom Field:${TestRuns[n].TestSteps[m].<Step Custom Field>}
        // Iterating over attachments for each test step
        #{for l=TestRuns[n].TestSteps[m].AttachmentsCount}
            Id: ${TestRuns[n].TestSteps[m].Attachments[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Attachments[l].Name}
            Image: ${TestRuns[n].TestSteps[m].Attachments[l].Image}
            FileURL: ${TestRuns[n].TestSteps[m].Attachments[l].FileURL}
        #{end}
        // Iterating over evidences for each test step
        #{for l=TestRuns[n].TestSteps[m].EvidencesCount}
            Id: ${TestRuns[n].TestSteps[m].Evidences[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Evidences[l].Name}
			File URL: ${TestRuns[n].TestSteps[m].Evidences[l].FileURL}
			Evidence: ${TestRuns[n].TestSteps[m].Evidences[l].Evidence}
        #{end}
        // Iterating over defects for each test step
        #{for l=TestRuns[n].TestSteps[m].DefectsCount}
            Description: ${TestRuns[n].TestSteps[m].Defects[l].Description}
            Id: ${TestRuns[n].TestSteps[m].Defects[l].Id}
            Key: ${TestRuns[n].TestSteps[m].Defects[l].Key}
            Summary: ${TestRuns[n].TestSteps[m].Defects[l].Summary}
        #{end}
    #{end}
#{end}
```

### Exporting Parameterized Tests from a Test Run

To export all this data, first you need to execute the Test Run. 

If you change any data, you need to return to the Execution page and merge it with the new data.

| **Fields** | **Description** |
| --- | --- |
| *ParametersCount* | Total of [Parameters](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44566351) declared in the Dataset |
| *IsDataDriven* | Returns "true" if the current Test Run is data-driven; otherwise, it returns "false" |
| *IterationsOverallExecutionStatus* | List of all the statuses in the current Test Run iteration and their percentages |
| *IterationsOverallExecutionStatus.STATUS.Count* | The number of STATUS in the Test Run iterations |
| *Iterations Overall Execution Status.STATUS.Percentage* | The percentage of STATUS in the Test Run iterations |
| *Parameters* | List of the parameters from each Test Run iteration |


> ℹ️ **Data-driven**
> ℹ️ 
> ℹ️ The field *IsDataDriven* is going to return TRUE only if the Test Run has more than one iteration.

#### Exporting Test Runs Parameters from a Test

For each Test Run Parameter, you can export the following fields:

- *Key*
- *Value*

Below is an example of how to iterate over the list of **Test Run ****Parameters** associated with a **Test.**

##### **Some mappings you can export from Test Runs Parameters**

```
// Iterating each test run
#{for testruns}
	// Iterating over parameters for each test run
    Parameters Total: ${TestRuns[n].ParametersCount}
	#{for m=TestRuns[n].ParametersCount}
        Key: ${TestRuns[n].Parameters[m].Key}
        Value: ${TestRuns[n].Parameters[m].Value}
    #{end}
#{end}
```

#### Exporting Test Runs Iterations from a Test

For each Test Run Iteration, you can export the following fields:

- *Overall Execution Status*
- *Parameters from Test Run Iterations*
- *Test steps from Test Run Iterations*

Below is an example of how to iterate over the list of **Test Run Iterations** associated with a **Test**.

##### **Some mappings you can export from Test Run Iterations**

```
// Iterating each test run
#{for testruns}
	IsDataDriven: ${TestRuns[n].IsDataDriven}	
	
	// Iterations Overall Execution Status (percentage + total of testes per status)
	List of Statuses: ${TestRuns[n].Iterations Overall Execution Status}
	TO DO: ${TestRuns[n].Iterations Overall Execution Status.TO DO.Percentage}% - ${TestRuns[n].Iterations Overall Execution Status.TO DO.Count}
    EXECUTING: ${TestRuns[n].Iterations Overall Execution Status.EXECUTING.Percentage}% - ${TestRuns[n].Iterations Overall Execution Status.EXECUTING.Count}
    PASSED: ${TestRuns[n].Iterations Overall Execution Status.PASSED.Percentage}% - ${TestRuns[n].Iterations Overall Execution Status.PASSED.Count}
    FAILED: ${TestRuns[n].Iterations Overall Execution Status.FAILED.Percentage}% - ${TestRuns[n].Iterations Overall Execution Status.FAILED.Count}
    ABORTED: ${TestRuns[n].Iterations Overall Execution Status.ABORTED.Percentage}% - ${TestRuns[n].Iterations Overall Execution Status.ABORTED.Count}

	// Iterating over test runs iterations
    Total of Iterations from a Test Run: ${TestRuns[n].IterationsCount}
	#{for m=TestRuns[n].IterationsCount}
		Name: ${TestRuns[n].Iterations[m].Name}
		Status: ${TestRuns[n].Iterations[m].Status}
		Parameters: ${TestRuns[n].Iterations[m].Parameters}

		// Iterating over parameters for each test run iteration
		Parameters Total: ${TestRuns[n].Iterations[m].ParametersCount}
		#{for l=TestRuns[n].Iterations[m].ParametersCount}
			Key: ${TestRuns[n].Iterations[m].Parameters[l].Key}
			Value: ${TestRuns[n].Iterations[m].Parameters[l].Value}
		#{end}

		// Iterating over preconditions for each test run iteration
    	Preconditions Total: ${TestRuns[n].Iterations[m].PreConditionsCount}
		#{for l=TestRuns[n].Iterations[m].PreConditionsCount}
     	    Definition: ${TestRuns[n].Iterations[m].PreConditions[l].PreCondition.Definition}
    	    Type: ${TestRuns[n].Iterations[m].PreConditions[l].PreCondition.Type}
    	#{end}

		//Iterating over test steps for each test run iteration
		#{for i=TestRuns[n].Iterations[m].TestStepsCount}
			Step Number: ${TestRuns[n].Iterations[m].TestSteps[i].StepNumber}
			Action: ${TestRuns[n].Iterations[m].TestSteps[i].Action}
			Data: ${TestRuns[n].Iterations[m].TestSteps[i].Data}
			Expected Result: ${TestRuns[n].Iterations[m].TestSteps[i].ExpectedResult}
			Status: ${TestRuns[n].Iterations[m].TestSteps[i].Status}
			Comment: ${TestRuns[n].Iterations[m].TestSteps[i].Comment}
			Actual Result: ${TestRuns[n].Iterations[m].TestSteps[i].ActualResult}
			// Replace the placeholder text to export any custom field associated with the test step.
        	Step Custom Field:${TestRuns[n].Iterations[m].TestSteps[i].<Step Custom Field>}
			
			// Iteration Test Step Attachments
			#{for l=TestRuns[n].Iterations[m].TestSteps[i].AttachmentsCount}
				Id: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].Id}
				Name: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].Name}
				Image: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].Attachment}
				FileURL: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].FileURL}
			#{end}
			// Iteration Test Step Evidences
			#{for l=TestRuns[n].Iterations[m].TestSteps[i].EvidencesCount}
				Id: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].Id}
				Name: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].Name}
				File URL: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].FileURL}
				Evidence: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].Evidence}
			#{end}
			// Iteration Test Step Defects
			#{for l=TestRuns[n].Iterations[m].TestSteps[i].DefectsCount}
				Description: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Description}
				Id: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Id}
				Key: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Key}
				Summary: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Summary}
			#{end}
		#{end}
	#{end}
#{end}
```

## Exporting Test Versions from a Test

Below is an example of how to iterate over the list of **Test Versions** associated with a **Test. **For each Test Version, you can export the following fields:

- *Name* (version's name, given when creating).
- *Number* (sequential, reflects the creation order the Test's Test versions).
- *Author, AuthorId and AuthorEmailAddress* (from the Jira user's display data).
- *Created* (date and time).
- *Updated* (date and time).
- *TestType* (Xray Test Type of the version).
- *IsDefault* (only one version can be the default, per Test).
- *IsArchived* (at least one version has to be unarchived since the default version can't be archived).
- *TestStepsCount* (number of manual Steps, if any, or zero).
- *CucumberScenario* (Cucumber Scenario definition, if existing).
- *Generic Test Definition* (Generic Test Definition, if existing).


##### **Iterate over Test Versions**

```
Number of Test Versions: ${TestVersionsCount}

// Iterating over each test version:
#{for testVersions}
  Version Name: ${TestVersions[n].Name}
  Version Number: ${TestVersions[n].Number}
  Author ID: ${TestVersions[n].AuthorId}
  Author Display Name: ${TestVersions[n].Author}
  Author Email Address: ${TestVersions[n].AuthorEmailAddress}
  Created: ${TestVersions[n].Created}
  Updated: ${TestVersions[n].Updated}
  Test Type: ${TestVersions[n].TestType}
  Is Default: ${TestVersions[n].isDefault}
  Is Archived: ${TestVersions[n].isArchived}
  TestStepsCount: ${TestVersions[n].TestStepsCount}
  Cucumber Scenario: ${TestVersions[n].Cucumber Scenario}
  Generic Test Definition: ${TestVersions[n].Generic Test Definition}

  
  // Iterating over each version's manual steps:
  #{for a=TestVersions[n].TestStepsCount}
    Action: ${TestVersions[n].TestSteps[a].Action}
    Data: ${TestVersions[n].TestSteps[a].Data}
    Result: ${TestVersions[n].TestSteps[a].ExpectedResult}
  #{end}


  // Iterating over each version's preconditions:
  #{for m=TestVersions[n].PreConditionsCount}
    PreCondition key: ${TestVersions[n].PreConditions[m].Key}
  #{end}


  // Iterating over each version's test runs:
  #{for t=TestVersions[n].TestRunsCount}
    IsDataDriven: ${TestVersions[n].TestRuns[t].IsDataDriven}
    Executed by: ${TestVersions[n].TestRuns[t].Executed By}
    Execution Status: ${TestVersions[n].TestRuns[t].Execution Status}
    Started on: ${TestVersions[n].TestRuns[t].Started On}
    Finished on: ${TestVersions[n].TestRuns[t].Finished On}

    // Iterating over test steps for each test run
    Test Steps Total: ${TestVersions[n].TestRuns[t].TestStepsCount}
    #{for m=TestVersions[n].TestRuns[t].TestStepsCount}
      Action: ${TestVersions[n].TestRuns[t].TestSteps[m].Action}
      Comment: ${TestVersions[n].TestRuns[t].TestSteps[m].Comment}
      Data: ${TestVersions[n].TestRuns[t].TestSteps[m].Data}
      Expected Result: ${TestVersions[n].TestRuns[t].TestSteps[m].ExpectedResult}
      Actual Result: ${TestVersions[n].TestRuns[t].TestSteps[m].ActualResult}
      Status: ${TestVersions[n].TestRuns[t].TestSteps[m].Status}
      Step Number: ${TestVersions[n].TestRuns[t].TestSteps[m].StepNumber}
      // Iterating over attachments for each test step
      #{for l=TestVersions[n].TestRuns[t].TestSteps[m].AttachmentsCount}
        Id: ${TestVersions[n].TestRuns[t].TestSteps[m].Attachments[l].Id}
        Name: ${TestVersions[n].TestRuns[t].TestSteps[m].Attachments[l].Name}
        Image: ${TestVersions[n].TestRuns[t].TestSteps[m].Attachments[l].Image}
        FileURL: ${TestVersions[n].TestRuns[t].TestSteps[m].Attachments[l].FileURL}
      #{end}
      // Iterating over evidences for each test step
      #{for l=TestVersions[n].TestRuns[t].TestSteps[m].EvidencesCount}
        Id: ${TestVersions[n].TestRuns[t].TestSteps[m].Evidences[l].Id}
        Name: ${TestVersions[n].TestRuns[t].TestSteps[m].Evidences[l].Name}
        File URL: ${TestVersions[n].TestRuns[t].TestSteps[m].Evidences[l].FileURL}
        Evidence: ${TestVersions[n].TestRuns[t].TestSteps[m].Evidences[l].Evidence}
      #{end}
      // Iterating over defects for each test step
      #{for l=TestVersions[n].TestRuns[t].TestSteps[m].DefectsCount}
        Description: ${TestVersions[n].TestRuns[t].TestSteps[m].Defects[l].Description}
        Id: ${TestVersions[n].TestRuns[t].TestSteps[m].Defects[l].Id}
        Key: ${TestVersions[n].TestRuns[t].TestSteps[m].Defects[l].Key}
        Summary: ${TestVersions[n].TestRuns[t].TestSteps[m].Defects[l].Summary}
      #{end}
    #{end}
  #{end}
#{end}
```

> ℹ️ **Tests and Test Versions**
> ℹ️ 
> ℹ️ When exporting Test data from a Test, it will export the default Test version. If you need the Test version info, it's also possible to retrieve that information. However, a filter must be applied when going through the Test versions to filter out the intended one. 
> ℹ️ 
> ℹ️ For example, if you only want the Test Version number 2 you must do something like: 
> ℹ️ 
> ℹ️ ```
> ℹ️ #{for testVersions}
> ℹ️   #{if (%{'${TestVersions[n].Number}'.equals('2')})}
> ℹ️     Version Name: ${TestVersions[n].Name}
> ℹ️     Version Number: ${TestVersions[n].Number}
> ℹ️     Author ID: ${TestVersions[n].AuthorId}
> ℹ️     Version Test Type: ${TestVersions[n].TestType}
> ℹ️     Version Is Archived: ${TestVersions[n].isArchived}
> ℹ️   #{end}
> ℹ️ #{end}
> ℹ️ ```

# <span style="color: #172B4D">Example</span>

<span style="color: #172B4D"> shows an example with all the mappings available to export from a</span><span style="color: #172B4D"> </span>**Test.**


<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577312).
</details>