ALM Open Test Architecture API Reference Version 12.55
Remove requirement target release cycle
Public Sub RemoveCycle()
' Remove requirement target release cycle
    
' Remove one or all of a requirement's target release cycles.
'  If cycleToRemoveId is less than zero, all target cycles
'   are removed.
' If cycleToRemoveId is a cycle ID, that cycle is removed.

' This code can be adapted to remove target releases
'  by using RQ_TARGET_REL as the requirement.Field.
    
    Dim rFactory As ReqFactory
    Dim requirement As Req
    Dim cyc As cycle
    Dim listOfCycles As List
    Dim strCyclesNames As String
    Dim indx As Long
    Dim requirementId As Long, cycleToRemoveId As Long

    requirementId = 10
    cycleToRemoveId = -1
    
    Set rFactory = tdc.ReqFactory
    Set requirement = rFactory.Item(requirementId)
    
    Set listOfCycles = requirement.Field("RQ_TARGET_RCYC")
    
    If (cycleToRemoveId <= 0) Then
        requirement.Field("RQ_TARGET_RCYC") = ""
    Else
        Set listOfCycles = requirement.Field("RQ_TARGET_RCYC")
        For indx = listOfCycles.Count To 1 Step -1
            Set cyc = listOfCycles.Item(indx)
            If (cyc.ID = cycleToRemoveId) Then
                listOfCycles.Remove (indx)
            End If
        Next
        'Set the modified list of Releases Cycles.
        requirement.Field("RQ_TARGET_RCYC") = listOfCycles
    End If
    
    requirement.Post
    
    'Extract the names of the remaining cycles.
    strCyclesNames = "Cycles are: "
    For Each cyc In listOfCycles
        strCyclesNames = strCyclesNames & cyc.Name & "(" & cyc.ID & "), "
    Next
    
    Debug.Print strCyclesNames
    
    Set rFactory = Nothing
    Set requirement = Nothing
    Set cyc = Nothing
    Set listOfCycles = Nothing

End Sub