---
title: "Integrity Checker"
canonical: "https://docs.getxray.app/space/XRAY/301668466/Integrity%20Checker"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

# Introduction

The Integrity Checker allows you to check and fix invalid or duplicated values in the Xray data. It also enables you to clear Xray-calculated custom fields, import automated steps from existing issues to the Automated Steps Library and fix integrity of Test Repositories and Test Plan Boards.

![image](media://484a980d-66fb-4fec-bd83-8253a0f2addd)

# Access

From the [Administration & Configuration settings](https://getxraydocs.atlassian.net/wiki/spaces/XRAY/pages/301501144).

## Integrity Checker

This section allows you to fix invalid Xray values that are stored in the database.

![image](media://277cc4a9-b156-49b5-a67c-5e5a39dcc88e)

![image](media://99a924a2-6eae-4604-82e5-8475c62859d3)

### <span style="color: #000000">Test Runs</span>

You can check and fix invalid or duplicated Test Runs.

![image](media://00773c41-54d0-4721-bfbe-c65e041348c1)

### <span style="color: #000000">Test Steps</span>

<span style="color: #000000">You can check and fix invalid Test Steps and Mementos. A Memento is a copy of a Test Run so that when a Test is changed, the Test Run keeps the state prior to the Test changes.</span>

![image](media://5f3f196e-7771-474f-865b-7cff98d317c6)

### <span style="color: #000000">Xray Issue Links</span>

<span style="color: #000000">You can check and fix Invalid Issue Links. These links can be of type Test Set <-> Test and Test <-> Precondition.</span>

![image](media://a371a165-5a91-4be3-9538-8f1f1dc6bbfa)

### <span style="color: #000000">Archived and unarchived entities</span>

<span style="color: #000000">You can check and fix invalid archived and unarchived entities (Test Runs and Tests in Test Repositories and Test Plan Boards).</span>

<span style="color: #000000">An invalid archived Xray entity is the one whose Jira issue is active and an invalid unarchived Xray entity is the one whose Jira issue is archived.</span>

<span style="color: #000000">Example of incoherent states fixed by these options:</span>

- <span style="color: #000000">A Test Run is wrongly archived if the Test Execution and Test issues are active</span>
- <span style="color: #000000">A Test Run is wrongly unarchived if the Test Execution and Test issues are archived</span>
- <span style="color: #000000">An archived Test should never be displayed in the Test Repository</span>

![image](media://ae4ceba4-2c6a-41ac-a855-0d3290ae24de)

## Calculated Custom Field Values

Starting from version 2.0.0 of Xray, the following Xray custom fields are recalculated upon any change and stored to be used when necessary. This means the value for a custom field is not calculated every time it is displayed. This improves performance considerably for several Xray screens and queries.

Because Jira does not provide the appropriate mechanisms and notifications for certain events like issue link events ([https://jira.atlassian.com/browse/JRA-8505](https://jira.atlassian.com/browse/JRA-8505)), Xray needs to intercept all requests that might change links and perform the appropriate calculations on its custom fields. Despite our best effort, there might be certain use cases where the custom fields are not updated, resulting in outdated values. When this happens, we provide the ability to remove the value of all custom fields. The value will then be calculated upon first access, or when a Jira re-index operation is performed.

Aside from being able to clear the custom field values, you can do bulk operations for:

- Resetting the value of the **Requirement Status** custom field on Requirement issues
- Resetting the value of the **TestRunStatus** custom field on Test issues

Additionally, Xray provides some specific issue operations that allow you to clear the custom field values individually:

- Resetting the **Requirement Status** custom field for a Requirement issue
- Resetting the **TestRunStatus** custom field for a Test issue
- Resetting the **Test Execution Defects Count** custom field for a Test Execution and Sub-Test Execution issue.

The Xray calculated custom fields that you can clear are:

- **Requirement Status Cache**

Cache that contains all the Requirement Status that were previously calculated

- **Test Run Status Custom Field **

Calculated Custom Field that has the Test Run Status for a Test

- **Manual Steps Count Custom Field**

Calculated Custom Field that has the number of Manual Steps of a Test

- **Test Set Test Count and Test Plan Test Count**

Calculated Custom Field that has the number of Test Sets and Test Plans of a Test

- **Test Execution Defects Custom Field**

Calculated Custom Field that has the number of defects created in the context of a Test Execution

![image](media://af61ab96-9826-4a58-8775-a7112525cab5)

## Automated Steps Library

From Xray version 3.2, you have access to the Automated Steps Library. When upgrading from previous versions you may want to import your existing Cucumber steps to the steps library of your project.

### Missing Test Steps

Cucumber Test Steps that are not currently in the Automated Steps Library.

### Missing Pre-Condition Steps

Cucumber Pre-Condition Steps that are not currently in the Automated Steps Library.

### Orphan automated Steps and Labels

Automated Steps that are not associated with any Test or Pre-Condition issues and automated Labels that are not associated with any step.

![image](media://b16960ba-cc12-4f57-9a38-48100d4e525f)

## Hierarchical Test Organization

Due to errors or misusage, a Test Repository may end up with references to Issues that are no longer Tests of that project, or, in the case of a Test Plan Board, references to issues that are no longer Tests of that Test Plan. These errors can be fixed in this section and you may select the repository types you want to fix.

![image](media://8eb45cae-d878-4e63-90e6-72da64025714)

  


## Cluster Lock

The <span style="color: #172b4d">cluster lock mechanism was designed to work with statically-named locks. The implementation stores each lock in the database permanently. Therefore using dynamically generated lock names, such as "lock_for_task_" + taskId, causes rows to pile up in large numbers in the clusterlockstatus table, and there is no mechanism to prune them. So, in certain circumstances, you can prune them:</span>

- <span style="color: #172b4d">Having more than 100.000 cluster locks created by Xray and having the com.xpandit.raven.clearClusterLockOnIntegrityChecker dark feature enabled.</span>

![image](media://4412268b-3d5c-47db-a111-e1b97a245750)

You can find more info here: [Usage tips to improve performance](https://getxraydocs.atlassian.net/wiki/spaces/XRAY/pages/301668466) on Data Center Tips