Search code examples
alm

Using ALM OTA, how do we know if an ALM Resource is checked out?


I have a requirement to upload a modified Resource file into ALM Test Resources. Before uploading, I need to verify if the Resource is Checked out, if not I need to Checkout that Resource.

I need to perform all these actions using OTA. I am able to get the particular resource object, and able to checkout/checkin.

But, I am not able to get the Version Control status (checkedout/checkedin). I found from ALM OTA API Reference that IsCheckedOut property can give us this result, but I am not getting on how this property to be used. Below is my code -

objFilter.Filter("RSC_FOLDER_NAME") = QCResourceFolderPath
Set objResourcesList = objFilter.NewList
For Each Resource In objResourcesList
    If Resource.Name = strFileName Then
        Resource.VC.Checkout ""
        Exit For
    End If
Next

This piece of code is performing Checkout operation, but am not able to use IsCheckedOut Property here.


Solution

  • got the answer. below piece of code gives me the checkedout status

    Resource.VersionData.IsCheckedOut
    

    So my code would be like this -

    objFilter.Filter("RSC_FOLDER_NAME") = QCResourceFolderPath
    Set objResourcesList = objFilter.NewList
    For Each Resource In objResourcesList
        If Resource.Name = strFileName Then
            If Not(Resource.VersionData.IsCheckedOut) Then
                Resource.VC.Checkout ""
                Exit For
            End If
        End If
    Next