您可以發佈新的缺陷每次自動測試實例狀態發生改變並把這個新的缺陷,以目前選定的測試實例。
在測試實驗室模塊腳本流程把這個代碼:
Sub TestSetTests_FieldChange(FieldName)
On Error Resume Next
If FieldName = "TC_STATUS" and TestSetTest_Fields.Field("TC_STATUS").Value = "Failed" Then
Set BugFact = TDConnection.BugFactory
Set NewBug = BugFact.AddItem(null)
'Fill new defect fields
NewBug.Summary = "New Defect"
NewBug.Field("BG_SEVERITY") = "3-High"
NewBug.Field("BG_STATUS") = "New"
NewBug.Field("BG_DETECTION_DATE") = "2016-01-01"
'...
NewBug.Post()
TestInstanceId = TestSetTest_Fields.Field("TC_TESTCYCL_ID").Value
Set TestInstanceFact = TDConnection.TSTestFactory
Set TestInstance = TestInstanceFact.Item(TestInstanceId)
Set NewBugLinkFact = TestInstance.BugLinkFactory
Set NewBugLink = NewBugLinkFact.AddItem(null)
NewBugLink.TargetEntity = NewBug
NewBugLink.Post
End If
On Error GoTo 0
End Sub
或者,如果你與ALM 12.53工作,你可以嘗試在執行從所有模塊桅頂「新缺陷」的行動。
Actions.Action("HeaderActions.HeaderNewDefect").Execute