Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The goal of this page is to describe the effects of archiving issues on Xray.

Table of Contents

...

Archiving Test Executions

...

Info

Archiving old Test Executions is a good use case for archiving Xray issues, especially if continuous integration processes are used. These can quickly create many Test Execution issues while importing new execution results into Xray on a daily basis. These issues are good candidates to be archived.

...

...

Test Runs archived via Test Execution issue can be restored at any time by restoring the Test Execution issue.

...

Archiving Tests

Archived Test issues:

...

Archiving Test Runs

Archiving a Test issue also automatically archives its will also archive its related Test Runs with the same effects described previously when archiving via Test Execution issue.

Test Runs archived via Test issue can be restored at any time by restoring the Test issue.

...

Archiving Test Plans

Archiving Test Plans will hide them from:

...

An archived Test Plan issue can be restored anytime, doing so will retrieve the Test Plan state prior to archiving and all of the Test Plan-scoped statuses for Tests and Requirements.

...

Archiving Requirements

Archived requirements Requirements will be excluded from:

  • Xray built-in reports and gadgets
  • Document generator exports
  • Search results of Xray JQL functions

Archiving requirements Requirements will also archive their Sub-Test Executions.

...

In case a Requirement is archived, its Sub-Test Executions will be archived as well. A Sub-Test Execution has the same functionalities of a Test Execution so archiving them have the same effect as archiving a Test Execution issue, namely all its Test Runs will be archived.

...

Archiving Test Sets and Pre-Conditions

...

Archived Test Sets and Pre-Conditions will be excluded from:

  • Xray reports and gadgets
  • Document generator exports
  • Search results of Xray JQL functions
  • Test Sets and Pre-Condition sections in the Test issue view 1

...

Archiving Projects

When archiving a Project all its issues are archived as well, including the Xray ones.

The effects of project archiving on Jira and Xray will be the same as archiving issues. For example, the archived issues will no longer be present on JQL results and if Test or Test Executions are found, Xray will also archive their internal data, namely its Test Runs.

...

Code Block
languagesql
titlePostgreSQL
collapsetrue
--The below query returns the number of non-archived test runs in the project. Once it reaches 0, all test runs where successfully archived. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_test_runs
FROM "AO_8B1069_TEST_RUN" tr
JOIN jiraissue exec_issue on exec_issue.id=tr."TEST_EXEC_ISSUE"
JOIN project p1 on p1.id=exec_issue.project 
JOIN jiraissue test_issue on test_issue.id=tr."TEST_ISSUE_ID"
JOIN project p2 on p2.id=test_issue.project 
WHERE (tr."ARCHIVED" = 'N' or tr."ARCHIVED" IS NULL) 
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')

--The below query returns the number of active tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully hidden. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_tests
FROM "AO_8B1069_LEAF" leaf
JOIN jiraissue test on test.id=leaf."TEST_ID"
JOIN project p1 on p1.id=test.project
WHERE (leaf."ARCHIVED" = 'N' or leaf."ARCHIVED" IS NULL)
AND (p1.pkey = '<PROJ_KEY>')
Code Block
languagesql
titleMySQL
collapsetrue
-- The below query returns the number of non-archived test runs in the project. Once it reaches 0, all test runs where successfully archived. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_test_runs
FROM AO_8B1069_TEST_RUN tr
JOIN jiraissue exec_issue on exec_issue.id=tr.TEST_EXEC_ISSUE
JOIN project p1 on p1.id=exec_issue.project
JOIN jiraissue test_issue on test_issue.id=tr.TEST_ISSUE_ID
JOIN project p2 on p2.id=test_issue.project
WHERE (tr.ARCHIVED = 'N' or tr.ARCHIVED IS NULL)
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')
 
-- The below query returns the number of active tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully hidden. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_tests
FROM AO_8B1069_LEAF leaf
JOIN jiraissue test on test.id=leaf.TEST_ID
JOIN project p1 on p1.id=test.project
WHERE (leaf.ARCHIVED = 'N' or leaf.ARCHIVED IS NULL)
AND (p1.pkey = '<PROJ_KEY>')
Code Block
languagesql
titleOracle
collapsetrue
--The below query returns the number of non-archived test runs in the project. Once it reaches 0, all test runs where successfully archived. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_test_runs
FROM "AO_8B1069_TEST_RUN" tr
JOIN jiraissue exec_issue on exec_issue.id=tr."TEST_EXEC_ISSUE"
JOIN project p1 on p1.id=exec_issue.project
JOIN jiraissue test_issue on test_issue.id=tr."TEST_ISSUE_ID"
JOIN project p2 on p2.id=test_issue.project
WHERE (tr."ARCHIVED" = 'N' or tr."ARCHIVED" IS NULL)
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')
 
--The below query returns the number of active tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully hidden. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_tests
FROM "AO_8B1069_LEAF" leaf
JOIN jiraissue test on test.id=leaf."TEST_ID"
JOIN project p1 on p1.id=test.project
WHERE (leaf."ARCHIVED" = 'N' or leaf."ARCHIVED" IS NULL)
AND (p1.pkey = '<PROJ_KEY>')
Code Block
languagesql
titleMSSQL
collapsetrue
--The below query returns the number of non-archived test runs in the project. Once it reaches 0, all test runs where successfully archived. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_test_runs
FROM "AO_8B1069_TEST_RUN" tr
JOIN jiraissue exec_issue on exec_issue.id=tr."TEST_EXEC_ISSUE"
JOIN project p1 on p1.id=exec_issue.project 
JOIN jiraissue test_issue on test_issue.id=tr."TEST_ISSUE_ID"
JOIN project p2 on p2.id=test_issue.project 
WHERE (tr."ARCHIVED" = 'N' or tr."ARCHIVED" IS NULL) 
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')

--The below query returns the number of active tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully hidden. Replace <PROJ_KEY> with the project key.
SELECT count(*) as active_tests
FROM "AO_8B1069_LEAF" leaf
JOIN jiraissue test on test.id=leaf."TEST_ID"
JOIN project p1 on p1.id=test.project
WHERE (leaf."ARCHIVED" = 'N' or leaf."ARCHIVED" IS NULL)
AND (p1.pkey = '<PROJ_KEY>')

...

Code Block
languagesql
titlePostgreSQL
collapsetrue
--The below query returns the number of archived test runs in the project. Once it reaches 0, all test runs where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_test_runs
FROM "AO_8B1069_TEST_RUN" tr
JOIN jiraissue exec_issue on exec_issue.id=tr."TEST_EXEC_ISSUE"
JOIN project p1 on p1.id=exec_issue.project 
JOIN jiraissue test_issue on test_issue.id=tr."TEST_ISSUE_ID"
JOIN project p2 on p2.id=test_issue.project 
WHERE tr."ARCHIVED" = 'Y' 
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')

--The below query returns the number of archived tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_tests
FROM "AO_8B1069_LEAF" leaf
JOIN jiraissue test on test.id=leaf."TEST_ID"
JOIN project p1 on p1.id=test.project
WHERE (leaf."ARCHIVED" = 'Y')
AND (p1.pkey = '<PROJ_KEY>')
Code Block
languagesql
titleMySQL
collapsetrue
-- The below query returns the number of archived test runs in the project. Once it reaches 0, all test runs where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_test_runs
FROM AO_8B1069_TEST_RUN tr
JOIN jiraissue exec_issue on exec_issue.id=tr.TEST_EXEC_ISSUE
JOIN project p1 on p1.id=exec_issue.project
JOIN jiraissue test_issue on test_issue.id=tr.TEST_ISSUE_ID
JOIN project p2 on p2.id=test_issue.project
WHERE tr.ARCHIVED = 'Y'
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')
 
-- The below query returns the number of archived tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_tests
FROM AO_8B1069_LEAF leaf
JOIN jiraissue test on test.id=leaf.TEST_ID
JOIN project p1 on p1.id=test.project
WHERE (leaf.ARCHIVED = 'Y')
AND (p1.pkey = '<PROJ_KEY>')
Code Block
languagesql
titleOracle
collapsetrue
--The below query returns the number of archived test runs in the project. Once it reaches 0, all test runs where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_test_runs
FROM "AO_8B1069_TEST_RUN" tr
JOIN jiraissue exec_issue on exec_issue.id=tr."TEST_EXEC_ISSUE"
JOIN project p1 on p1.id=exec_issue.project 
JOIN jiraissue test_issue on test_issue.id=tr."TEST_ISSUE_ID"
JOIN project p2 on p2.id=test_issue.project 
WHERE tr."ARCHIVED" = 'Y' 
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')

--The below query returns the number of archived tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_tests
FROM "AO_8B1069_LEAF" leaf
JOIN jiraissue test on test.id=leaf."TEST_ID"
JOIN project p1 on p1.id=test.project
WHERE (leaf."ARCHIVED" = 'Y')
AND (p1.pkey = '<PROJ_KEY>')
Code Block
languagesql
titleMSSQL
collapsetrue
--The below query returns the number of archived test runs in the project. Once it reaches 0, all test runs where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_test_runs
FROM "AO_8B1069_TEST_RUN" tr
JOIN jiraissue exec_issue on exec_issue.id=tr."TEST_EXEC_ISSUE"
JOIN project p1 on p1.id=exec_issue.project 
JOIN jiraissue test_issue on test_issue.id=tr."TEST_ISSUE_ID"
JOIN project p2 on p2.id=test_issue.project 
WHERE tr."ARCHIVED" = 'Y' 
AND (p1.pkey = '<PROJ_KEY>' OR p2.pkey = '<PROJ_KEY>')

--The below query returns the number of archived tests in project test repositories and test plan boards. Once it reaches 0, all tests where successfully restored. Replace <PROJ_KEY> with the project key.
SELECT count(*) as archived_tests
FROM "AO_8B1069_LEAF" leaf
JOIN jiraissue test on test.id=leaf."TEST_ID"
JOIN project p1 on p1.id=test.project
WHERE (leaf."ARCHIVED" = 'Y')
AND (p1.pkey = '<PROJ_KEY>')

...

Info
This section refers to the Xray custom issue links only (e.g. Tests associated with Pre-Conditions, with Test Sets, etc.) and not to the Jira native issue link featurelinks.

Archiving issues do not archive the associations links between Xray issues: for instance an active Test is still associated with an archived Test Set. For example, after archiving a Test Set its Tests will still be associated with it.

However, due to the fact that Xray Issue Data Table components, used for presentation of Xray issue linksassociations, are built on top of JQL searches and that archived issues no longer appear in those search results, some links will no longer be shown in some issue views.

Whenever that happens, a warning message will be displayed right at the top of the affected Xray Issue Data Table informing that some associated issues are being hidden from the UI. The below image shows an example of the Test Sets section in a Test issue view after archiving one of its related Test Sets.

...