Wednesday 11 January 2012

Quality Center - Query the defects linked for a Release folder

PROBLEM:
You wanted to know all the defects logged for particular Release (Release Folder).
Then you wanted to know the defect count that has (at least) linked to one or more testing items.

SOLUTION:
You need 3 tables (Release, Bug, and Release_Folders)

Query:
SELECT COUNT(BG.BG_BUG_ID)
FROM BUG BG, RELEASE_FOLDERS RF, RELEASES R
WHERE RF.RF_NAME = '5.0.0.0'
AND R.REL_PARENT_ID = RF.RF_ID
AND BG.BG_DETECTED_IN_REL = R.REL_ID
AND BG.BG_BUG_ID IN (SELECT LINK.LN_BUG_ID FROM LINK)

Quality Center - Delete all alerts (2 Levels) belong to the a root requirement

Problem:
There is no direct way to clear alerts belongs to others. However, it can be achieved by performed a DELETE query from Administration.
 
Solution:
Below are the query that will clear all alerts from to a root requirement. It will delete all the alerts 2 level descendent from the root.
 
Query:
DELETE FROM ALERT 
WHERE AT_ENTITY_TYPE = 'REQ'
AND AT_KEY1 IN (
SELECT RQ_REQ_ID FROM REQ where 
RQ_FATHER_ID IN (SELECT RQ_REQ_ID FROM REQ WHERE RQ_FATHER_ID = (SELECT RQ_REQ_ID FROM REQ WHERE RQ_REQ_NAME = 'Async SOAP'))
OR 
RQ_FATHER_ID IN (SELECT RQ_REQ_ID FROM REQ WHERE RQ_REQ_NAME = 'Async SOAP')
OR
RQ_REQ_NAME = 'Async SOAP'
)