ALM – Get Project ID in Workflow VBScript
Question ID: 104521
0
0

It does not appear that the OTA API has a specific property or method to grant access to the ID of the current project, and I’m wanting to get this information in the ALM workflow. For example, the TDConnection object has a ProjectName property, but it does not have a ProjectID property.

Does anyone have a suggestion on how to get this information?

Marked as spam
Posted by (Questions: 3, Answers: 2)
Asked on May 23, 2012 1:45 pm
252 views
Answers (2)
0
Private answer

Have you tried the **GetAllVisibleProjectDescriptors** and **ProjectDescriptor** objects?

**GetAllVisibleProjectDescriptors:**
The list of project descriptors under all domains that the current logged in user is allowed to connect to.

**ProjectDescriptor:**
Get a reference from the list returned by TDConnection.GetAllVisibleProjectDescriptors. The ProjectDescriptor.UId property returns the project's Unique ID number.

**ProjectDescriptor** seems to have a Uid property. According to the API Reference - ''Returns the project's Unique ID number.''

If this doesn't work out for you, you could always set up an ODBC connection inside of workflow and query it from qcsiteadmin_db. This would be insecure though as you would have to pass db login info in workflow.

Marked as spam
Posted by (Questions: 15, Answers: 10)
Answered on June 1, 2012 5:14 pm
0
Private answer

Thanks, Young Steve. Somehow, I was not putting those pieces together even though I did run across the GetAllVisibleProjectDescriptors method.

So, something like the following should work (I haven't tested it, because I found a workaround):

Dim projectID
Set visProjectsList = TDConnection.GetAllVisibleProjectDescriptors
For Each projDescr In visProjectsList
If projDescr.Name = TDConnection.ProjectName Then
projectID = projDescr.UId
Exit For
End If
Next

Marked as spam
Posted by (Questions: 3, Answers: 2)
Answered on June 8, 2012 11:22 am
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top