Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm able to query a HPQC database to retrieve execution information from the TEST and STEP tables.

I'm also able to query for defect information from the BUG tab.

But, I'm struggling to find a way to fetch the list of defects that have been associated with a failing step/test - could someone provide me a query that can join tests to bugs, or point me to the table that contains this information?

This is on an old HPQC 9.2 instance.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Turns out this was easily done using the LINKS table - here's an example of query to retrieve all the RUNS a bug is associated with:

SELECT DISTINCT LN_BUG_ID as BugId, LN_ENTITY_ID AS EntityId
FROM td.LINK
WHERE LN_ENTITY_TYPE = 'RUN'
UNION
SELECT LN_BUG_ID, ST_RUN_ID
FROM td.LINK
INNER JOIN td.STEP
ON LINK.LN_ENTITY_ID = STEP.ST_ID
WHERE LN_ENTITY_TYPE = 'STEP'
UNION
SELECT LN_BUG_ID, RN_RUN_ID
FROM td.LINK
INNER JOIN td.RUN
ON LINK.LN_ENTITY_ID = RUN.RN_TESTCYCL_ID
WHERE LN_ENTITY_TYPE = 'TESTCYCL'
share|improve this answer

Below link has the query and information to link the test lab and defects. how-to-retrieve-requirement-test-case

share|improve this answer
    
Welcome to SQA, Sham. On stackexchange links are usually not enough. It would help others if you summarize the content of the link. –  dzieciou Dec 4 '12 at 17:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.