Quality Center 12.2 test instance defect linkage-Existing Defect
Question ID: 106462
0
0

Hi all, We are running QC 12.2 . We are linking existing defects while manually running tests, However it does not automatically link it to the test instance. We want to be able to link it to the test instance. Or at least display the link icon in the list of test instances. Is there any way to link existing defects automatically to test instance via script? kind regards, Swarna
The code below links only for new defect. Can we reuse the code for Existing defects

Add this code to the ‘ActionCanExecute’ function:

If Actionname = "act_run" Then
Set us = TDConnection.UserSettings
us.Open "MySettings"
us.Value("LastTestInstanceID") = TestSetTest_Fields("TC_TESTCYCL_ID").Value
us.Close
us.Post
Set us = Nothing
End If
If Actionname = "act_end_run" or ActionName = "RfrshAct" Then
Set us = TDConnection.UserSettings
us.Open "MySettings"
us.DeleteValue "LastTestInstanceID"
us.Close
End If

Add this code to the Bug_AfterPost function:

Set us = TDConnection.UserSettings
us.Open "MySettings"
lTestInstanceId = us.Value("LastTestInstanceID")
BugID = Bug_Fields("BG_BUG_ID").Value
us.Close

if lTestInstanceId <> "" then

Set td = TDConnection
Set objTCtestFac = td.TSTestFactory
Set ojbTCtest = objTCtestFac.Item(lTestInstanceId)
Set objBugLinkFac = ojbTCtest.BugLinkFactory
Set objLink = objBugLinkFac.AddItem(BugID)
objLink.LinkType = "Related"
objLink.Post
End If
Set us = Nothing

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on October 27, 2015 4:11 am
69 views
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top