Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Re: Import of requirements gives unexpected error

$
0
0

Hi sundaytwins.

 

Could you try to add these codes to cleanup objects?

Public Function uploadRequirement(TdConnection, reqPath, reqName, reqType, reqAuthor, Optional reqPriority)
    Dim reqFact,req
    parentID = getIdOfRequirement(TdConnection, reqPath) ''Returns the ID of the parent folder/requirement       
    Set reqFact = TdConnection.ReqFactory
    Set req = reqFact.AddItem(Null)
    req.parentID = parentID
    req.TypeId = reqType
    req.name = reqName
    req.Author = reqAuthor
    If Not IsMissing(reqPriority) Then
        req.priority = reqPriority
    End If
    req.Post
    req.UnlockObject

    uploadRequirement = req.ID
    
    Set reqFact = nothing
    Set req = nothing  
    
End Function

Function getIdOfRequirement(tdc, parentReqPath)

    Dim result,reqFact,reqList   
    result = -1
    Set reqFact = tdc.ReqFactory
    Set reqList = reqFact.NewList("")
    For i = 1 To reqList.Count
        If reqList(i).path = parentReqPath Then
            result = reqList(i).ID
            Exit For
        End If
    Next

    getIdOfRequirement = result
    
    set reqFact = nothing
    set reqList = nothing

End Function

 

Br, Tomas


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>