We have run a Test Set where a few hundred test instances were supposed to be linked to a primary defect but were not. We are now having to go back and link these. Does anyone know of a faster route than manually updating each one? Is there possibly some workflow code that I can run?
Answer by Jafar · Aug 12, 2016 at 06:36 PM
You can uses this code as an example as to how this could be done using Workflow / API. This can be assigned to a toolbar button in the Test Lab and called from the ActionCanExecute trigger.
If ActionName = "AddBug" Then Set TestSetFilter = TDConnection.TestSetFactory.Filter TestSetFilter.Filter("CY_CYCLE") = """Mercury Tours Functionality""" Set TestSetList = TestSetFilter.NewList() For Each TestSet in TestSetList Set TestSetObj = TDConnection.TestSetFactory.Item(TestSet.ID) Set TSTestFilter = TestSetObj.TSTestFactory.Filter TSTestFilter.Filter("TC_STATUS") = "Failed" Set TSTestList = TSTestFilter.NewList() For Each TestInst in TSTestList Set BugLinkFact = TestInst.BugLinkFactory BugLinkFact.AddItem(40) 'SET BUG ID FOR THE LINK HERE Set BugLinkFact = Nothing Next Set TSTestList = Nothing Set TSTestFilter = Nothing Set TestSetObj = Nothing Next Set TestSetList = Nothing Set TestSetFilter = Nothing End If
How to hide a Defect tab 1 Answer
Defect Link Icon in Execution Grid 1 Answer