Versions Compared

Key

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

Before performing these actions, we recommend creating a backup of the table AO_8B1069_TEST_PRE_COND_LINK at least, and ideally, all the database.

Xray 7. x introduced a major bug (

Jira
serverXpand IT Issue Tracker
serverIdb6309ad5-5416-33d6-9a09-a3e02f20d3e6
keyXRAY-9359
) that would result in the loss of precondition links in specific conditions. 


To recover the majority of the links, we'll be using the mementos from past test runs created.

E.g Test ta was linked to Precond pa, a user created a Test Run, and this data is saved in the Test Run.



Warninginfo

This solution is not perfect and will not consider some situations:

  • Scenario A (no solution other than each user analyzing this information)
    • A Test ta was linked to a Pre-condition pa.
    • A Test Run was created.
    • The link has been intentionally removed, and the Test Run data was never reset or merged.
    • This query will re-insert the link. 
  • Scenario B (a second query will be provided to have the list of links to be fixed)
    • A Test ta was linked to a Pre-condition pa
    • A Test Run was created
    • The ta's test type or pa's precondition type changed have been changed
    • This query will re-insert the link 


The Based on the Test Runs data, the following query will insert all the missing links into the Test ↔ Pre-condition link table based on the Test Runs data. We recommend executing only the select first to validate the data and add more filters in case. you would like to recover the precondition links by project, date of test run or other.

...

Code Block
select pt."ID", pt."SOURCE_ISSUE" as test_id, pt."TARGET_ISSUE" as precond_id, CFO.CUSTOMVALUE as precondtype, CFO2.customvalue as test_type
from "AO_8B1069_TEST_PRE_COND_LINK" pt
join customfieldvalue cfv on cfv.issue= pt."TARGET_ISSUE"
join customfield cf on cfv.customfield= cf.id and cf.CUSTOMFIELDTYPEKEY like '%com.xpandit.plugins.xray:precondition-test-type-custom-field%'
JOIN customfieldoption CFO ON CFO.ID=CAST (cfv.stringvalue AS INTEGER)
join customfieldvalue cfv2 on cfv2.issue= pt."SOURCE_ISSUE"
join customfield cf2 on cfv2.customfield= cf2.id and cf2.CUSTOMFIELDTYPEKEY like '%com.xpandit.plugins.xray:test-type-custom-field%'
JOIN customfieldoption CFO2 ON CFO2.ID=CAST (cfv2.stringvalue AS INTEGER)
where CFO.CUSTOMVALUE <> CFO2.customvalue;

These queries are built for PostgreSQL.

The resolution for this was implemented starting from version 7.1.1 and subsequent releases.

Page properties
hiddentrue
Related issues

Jira
serverXpand IT Issue Tracker
columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverIdb6309ad5-5416-33d6-9a09-a3e02f20d3e6
keyXRAY-9359

...