NEW_ALM12 Outstanding Contributor.
Outstanding Contributor.
129 views

How to check if Version control is enabled in all projects through out all domains using OTA?

Jump to solution

Hi Folks, 

There is a sample code to check wheather VC is enabled or not. Code is as below: Copied from API ref guide:

Public Function IsVersionControlEnabled() As Boolean
' Check if version control is enabled Dim prj As ProjectProperties
Dim Enabled as Boolean

Set prj = my_TDConnection.ProjectProperties

If prj.ParamValue("VCS") = "Y" Then
Enabled = True
MsgBox "Version control is on"
Else
Enabled = False
MsgBox "Version control is off"
End If

Return Enabled
End Function
Source: https://admhelp.microfocus.com/alm/en/12.60/api_refs/ota/Default.htm#ota/topic58.html 

But, how do I use the sample code to find out which projects are VC enabled in a single shot. I have 1500 projects in 15 different domain. So I want to know out of 1500 projects which projects are version control enabled.

Woud some one help to get it using OTA?

Thanks in advance.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: How to check if Version control is enabled in all projects through out all domains using OTA?

Jump to solution

Replace the MsgBox lines with writing to a logfile.

Make sure that your user (or another account you can use) has access to all projects.

Then have your script loop over the projects this way:

 Set domainList = tdc.VisibleDomains
 For Each dom in domainList
        For Each proj In tdc.VisibleProjects(dom)
              tdc.Connect dom,  proj           
         ... ... .. (your code) ... .. ..
              tdc.Disconnect
        Next
Next

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
3 Replies
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: How to check if Version control is enabled in all projects through out all domains using OTA?

Jump to solution

Replace the MsgBox lines with writing to a logfile.

Make sure that your user (or another account you can use) has access to all projects.

Then have your script loop over the projects this way:

 Set domainList = tdc.VisibleDomains
 For Each dom in domainList
        For Each proj In tdc.VisibleProjects(dom)
              tdc.Connect dom,  proj           
         ... ... .. (your code) ... .. ..
              tdc.Disconnect
        Next
Next

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
NEW_ALM12 Outstanding Contributor.
Outstanding Contributor.

Re: How to check if Version control is enabled in all projects through out all domains using OTA?

Jump to solution

@Jan Czajkowski , I tried that way and did not work as i want. 

I am trying to connect to All projects throughout all domains, and check wheather VC is enabled or not. If VC is enabled in any project then count total number of Test cases, and Requirement that are Checked out.

I got this part. 

But, where i am at stuck is that my 1st project that is in the list of visible project is 9th from the visible project list. So, while populating data in excel sheet that domain/project name is populating row #10 instead of row #2. Value populating should start from ro #2 and increase by 1. 

So, at this point the issue Im getting is VC enable projects are not orderly populated in excel row. But they are populating in excel based on their numbering in ALM Site Admin. 

0 Likes
NEW_ALM12 Outstanding Contributor.
Outstanding Contributor.

Re: How to check if Version control is enabled in all projects through out all domains using OTA?

Jump to solution

Boom!!!

Finally made it. 

Thanks Jan!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.