---
title: "Test Case Versioning"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/44565571/Test%20Case%20Versioning"
format: markdown
---
![Banner-Xray-Documentation-Enterprise.png](media://70b2e2f0-dd32-419d-a777-c2717f21e148)


<details>
<summary>Table of Contents</summary>

> Macro (toc)
</details>

# Introduction

Test cases evolve when requirements change, or improvements are made to the application under test. Although Xray logs Test specification changes in the Jira history, it is not easy to revert to a specific Test case version. With Test case versioning, you can now create multiple versions of the same Test allowing you to:

- Mark specific milestones of the Test with versions.
- View all previous Test versions and revert to a particular version if needed.
- Have multiple active versions simultaneously, **even of different Test types**, as you can [execute](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565037) them all independently.

> ℹ️ ### Jira versions and Xray Test versioning
> ℹ️ 
> ℹ️ If you're wondering how to use Jira versions and Xray Test case versioning, please refer to [this article: TTT—Test Versioning](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565095).

# Operations

## Creating Test Versions

A Test Version is composed of the following fields on a Test Issue:

- Test Specification:
  - [Test Steps](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565316).
  - [Gherkin Steps](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565320).
  - [Scenario type](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565557).
  - Generic definition.
- Test Type.
- Dataset.
- [Preconditions](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565159).

A Test Version is defined with a **name**. You can choose the name for the versions explicitly when creating new versions. Xray will try to generate the version name automatically based on the latest version if the name ends with a suffix that is recognized as a version number. Nevertheless, you can always change this auto-generated name. It is also possible to rename existing versions.

To create a new Test version:

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Setting a Default Version

Every Test has a default version. The default version is the one Xray chooses when you create a new [Test Run](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565109) for the Test without specifying any particular version. When you create a new Test version, Xray automatically sets the v1 as default. However, it can be changed: you can manually set the default version.

> ✅ To make sure you always run your Test with the version you aim for, usually the most up-to-date one, you can manually mark a version as the default one. Note that there can be multiple versions active but only one can be marked the default one; therefore the default version is your preferred version.

The default version of a Test can't be deleted or archived.

To set the default version:

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > ℹ️ You can also set the default version through the *Manage versions* option (Figure 3 - 4).

## Viewing Test Versions

When [Xray Enterprise](https://www.getxray.app/xray-enterprise) is installed, a dropdown selector field for the Test versions will be provided on the top right corner of the Test Details web panel on the Test Issue. This dropdown provides all the Test versions as options and groups them into Active and Archived. The Test Type is also displayed for each version. The default version will be identified with a "default" tag.

When the Test issue is opened, the default version will be selected.

The Preconditions web panel is also affected by the currently selected version as it only displays the Preconditions associated with the selected version.

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Managing Test Versions

To better view and manage all versions of a Test, you can access a modal with a list of all the versions in the Test. Here you can do specific actions like:

- Renaming versions.
- Archiving/Unarchiving versions.
- Set the Default version.

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Archiving Test Versions

It is also possible to archive (and unarchive) Test versions. **Archived versions can not be executed: t**hey exist just for the historical record.

All Test runs of archived versions will remain accessible as a copy of the Test specification is always made whenever a Test Run is started.

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > ℹ️ You can unarchive an archived Test version by clicking the ellipsis button (Figure 6 - 6) and then selecting *Unarchive* version (Figure 8 - 2).
> > ℹ️ 
> > ℹ️ You can also archive Test versions from the manage versions dialog.

## Executing a Test Version

You can create new executions of a specific version from the Test Runs web panel on the Test Issue page. 

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > ℹ️ To add a new Test Run to an existing Test Execution Issue, repeat this process but choose the *Existing test execution...* option (Figure 9 - 2) from Step 1.
> > ℹ️ 
> > ℹ️ You can also create new Test Runs and specify a Test version when you add Tests to a Test Execution through the [Test Execution](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565117) screen.

## Deleting a Test Version

You can delete versions from a Test Issue using the Delete action provided by Xray in the Test details section. The Default version can not be deleted.

> ⚠️ When deleting a Test Version, all Test Runs executed for that version will also be deleted from Jira.

To delete a Test version from a Test version:

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Renaming a Test Version

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Xray History

All changes related to Test specification fields on Test versions are also logged to the Xray History view (Figure 10 - 1; 2). You can also filter history changes by Test version (Figure 10 - 3).

![Figure 13 - History](media://a008cc13-4b04-4477-ad31-c8ee315f437b)


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