When preparing for a migration to Xray Cloud, optimizing your data footprint is essential. Xray, as a data-intensive application, often includes Test Runs with extensive associated evidence. These Test Runs, along with the attachments, comprise the bulk of Xray data and are the main contributors to extended migration times.
Why Clean Up Old Test Run Data?
Data Intensity of Xray:
Test Runs typically include evidences of execution, making Xray storage-heavy. Over time, projects accumulate significant Test Run data, much of which may no longer be relevant.Impact on Migration Time:
The larger the Xray data footprint, the longer the migration process takes. Reducing unnecessary data by cleaning up outdated Test Runs can significantly improve migration efficiency.Outdated Test Runs:
As projects progress or close, many Test Runs become obsolete. It is often unnecessary to migrate this outdated data, especially when it doesn't serve any ongoing purpose.
Recommended Approach to Clean Up Test Run Data
Avoid Direct Database Deletion:
While it is technically possible to delete Test Run data directly from the database, this approach is strongly discouraged. Test Runs are linked to various tables, and direct deletion can corrupt data integrity. Additionally, this method can leave empty Test Execution issues, which clutter the database unnecessarily.
Use Jira's UI or REST API:
The best and recommended way to clean up old Test Run data is to delete the corresponding Test Execution issues. Deleting these issues ensures all associated Test Runs and related data are also removed, maintaining data integrity and leaving no orphaned records.
Steps to Delete Test Execution Issues
Identify Old Test Execution Issues: Use Jira's search functionality to locate Test Execution issues older than a specific date. For example:
issuetype = "Test Execution" AND created < "YYYY-MM-DD"
Replace
YYYY-MM-DD
with the desired cut-off date.Bulk Delete via Jira UI:
- Perform the search in Jira.
- Click Tools > Bulk Change > Delete Issues.
- Follow the prompts to delete the selected issues.
Using Jira REST API: For automation or advanced workflows, use Jira's REST API to delete Test Execution issues. For example:
DELETE /api/2/issue/{issueIdOrKey}
Replace
{issueIdOrKey}
with the specific issue key or ID of the Test Execution issue.
Key Benefits of This Approach
- Streamlined Migration: By cleaning up outdated Test Runs, only necessary and relevant data will be migrated, reducing migration time significantly.
- Data Integrity: Deleting Test Execution issues via Jira's UI or API ensures all associated Test Runs and related data are removed cleanly.
- Simplified Database: Avoid clutter from orphaned or unnecessary Test Execution issues.
By following these steps, you can effectively manage your Xray data footprint and ensure a smoother migration to Xray Cloud.