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

# Introduction

[Preconditions](https://docs.getxray.app/display/XRAYCLOUD/Precondition) <span style="color: #000000">specify</span><span style="color: #000000"> the conditions that need to be fulfilled to execute a test</span><span style="color: #000000">. </span><span style="color: #000000">A Precondition is like defining the step "0" for your tests.</span>

# Exporting Tests from a Precondition

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

All fields listed [here](https://docs.getxporter.app/space/XPORTERCLOUD/558575/Mappings) are available because the Precondition is a regular Jira issue.

In addition, you can export the following fields:

- Key: `${Key}`
- Summary: `${Summary} `
- Type: `${PreCondition.Type} `
- Definition: `${PreCondition.Definition}`

## <span style="color: #0d0d0d">Tests Associated with a Precondition</span>

[Xporter for Jira Cloud](https://marketplace.atlassian.com/apps/891368/xporter-export-issues-from-jira?tab=overview&hosting=cloud) allows rendering all Precondition's Tests. 

Below, you can find<span style="color: #0d0d0d"> examples of how to iterate over the list of Tests associated with a Precondition.</span>

```
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}
```

## Example

[This Word document](https://docsxporter.atlassian.net/wiki/download/attachments/430551/Xray_PreCondition.docx?version=1&modificationDate=1694009215605&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>