ALM Open Test Architecture API Reference Version 12.55
Link a defect to a requirement
Public Function LinkBugToReq(aBug As Bug, aReq As Req, _
    Optional theLinkType = "Related") As ILink

' Link a defect to a requirement

    Dim linkableReq As ILinkable
    Dim bToRLink As Link
    Dim BugLinkF As LinkFactory
    
    On Error GoTo FUNC_ERR
    
    Set linkableReq = aReq
    Set BugLinkF = linkableReq.BugLinkFactory
    Set bToRLink = BugLinkF.AddItem(aBug)
    bToRLink.LinkType = theLinkType ' "Related"
    bToRLink.Post
    
    Set LinkBugToReq = bToRLink
Exit Function
FUNC_ERR:
    Set LinkBugToReq = Nothing
End Function

Defect to defect links