---
title: "Exporting Test Plans"
canonical: "https://docs.getxporter.app/space/XPORTERCLOUD/528621/Exporting%20Test%20Plans"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

# Introduction

From a Test Plan, it's possible to export the following Xray data: [Tests](https://docs.getxporter.app/space/XPORTERCLOUD/560236) and [Test Executions](https://docs.getxporter.app/space/XPORTERCLOUD/560192).

All fields listed [<span style="color: #000000">here</span>](https://docs.getxporter.app/space/XPORTERCLOUD/528621/Exporting+Test+Plan)<span style="color: #000000"> </span>are available because the Test Plan is a regular Jira Issue.

In addition, you can export the following fields:

```
#Overall Execution Status (percentage + total of tests per status)

TO DO: ${Overall Execution Status.TO DO.Percentage}% - ${Overall Execution Status.TO DO.Count}
EXECUTING: ${Overall Execution Status.EXECUTING.Percentage}% - ${Overall Execution Status.EXECUTING.Count}
PASSED: ${Overall Execution Status.PASSED.Percentage}% - ${Overall Execution Status.PASSED.Count}
FAILED: ${Overall Execution Status.FAILED.Percentage}% - ${Overall Execution Status.FAILED.Count}
ABORTED: ${Overall Execution Status.ABORTED.Percentage}% - ${Overall Execution Status.ABORTED.Count}
```

# Exporting Data

## Exporting Tests from a Test Plan

Below, you can find examples of how to iterate over the list of [Tests](https://docs.getxporter.app/space/XPORTERCLOUD/560236) associated with a Test Plan.

```
Total number of associated tests: ${TestsCount}

// Iterating each test
#{for tests}
	Key: ${Tests[n].Key}
	Test Status: ${Tests[n].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[n].TestStepsCount}
		Action: ${Tests[n].TestSteps[m].Action}
		Data: ${Tests[n].TestSteps[m].Data}
		Expected Result: ${Tests[n].TestSteps[m].ExpectedResult}
	#{end}
#{end}
```

or

```
Total number of associated tests: ${TestsCount}

// Iterating each test
#{for j=TestsCount}
	Key: ${Tests[j].Key}
	Test Status: ${Tests[j].TestStatus}
	// Iterating over test steps for each test
	#{for m=Tests[j].TestStepsCount}
		Action: ${Tests[j].TestSteps[m].Action}
		Data: ${Tests[j].TestSteps[m].Data}
		Expected Result: ${Tests[j].TestSteps[m].ExpectedResult}
	#{end}
#{end}
```

## Exporting Test Executions from a Test Plan

Below, you can find examples of how to iterate over the list of [Test Executions](https://docs.getxporter.app/space/XPORTERCLOUD/560192/Exporting+Test+Execution) 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

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

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

## Example

[This Word document](https://docsxporter.atlassian.net/wiki/download/attachments/528621/Xray_Test_Plan.docx?version=1&modificationDate=1694009195913&cacheVersion=1&api=v2) is an example of how all the mappings available to export from a Precondition look.

<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://docs.getxporter.app/space/XPORTERCLOUD/18251779/In-App+Chat+Support).
</details>