Re: Is it possible to use pattern matching to extract the QC defects in OTA Script?? (300 Views)
Reply
Occasional Contributor
Neel_R
Posts: 8
Registered: ‎07-31-2013
Message 1 of 3 (343 Views)

Is it possible to use pattern matching to extract the QC defects in OTA Script??

Hi,

 

I have used regular expression while fetching defect details from QC using OTA script, but getting err message.

 

please find the below code for reference

 

Set tdc = CreateObject("tdapiole80.tdconnection")
tdc.InitConnectionEx "http://quc.com/qcbin/"
tdc.login "tester", "pwd"
tdc.Connect "project", "Releases"
Set BugFact = tdc.BugFactory
Set BugFilter = BugFact.Filter
BugFilter.Filter("BG_STATUS") = "Closed"
BugFilter.Filter("BG_PROJECT") = "'testproject'"
'BugFilter.Filter("BG_DETECTED_IN_RCYC") = "^Releases\2013\UAT Test^" - actual value
'using regular expression
BugFilter.Filter("BG_DETECTED_IN_RCYC") = "*UAT Test*"

Set BugList = BugFilter.NewList
MsgBox BugList.count

Next

 

Getting error message in the highlighted line. please help me on this.

 


Basically my aim is to identify the defect count in each phase(UAT, Unit testing, Integratin testing, etc ) for the project. plesae let me knw, if there are any other ways to achieve the same.

 

Thanks

Please use plain text.
Honored Contributor
Jan Czajkowski
Posts: 2,073
Registered: ‎12-12-2007
Message 2 of 3 (305 Views)

Re: Is it possible to use pattern matching to extract the QC defects in OTA Script??

If the filter causes an error from the GUI, then it won't work from the API. I haven't found a way of using wildcard in paths like this in QC. I think the reason is BG_DETECTED_IN_RCYC does not actually contain a path, but an integer referring to the ID of the cycle.

 

I guess what you will have to do is to iterate over the cycles and check their names. Then you can get the full path of them using the Path property, and the concatenate the paths with ORs in your filter condition.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
Please use plain text.
Frequent Advisor
Tomi_Assure
Posts: 35
Registered: ‎04-30-2010
Message 3 of 3 (300 Views)

Re: Is it possible to use pattern matching to extract the QC defects in OTA Script??

The BG_DETECTED_IN_RCYC does not actually contain the name but the ID as Jan indicated. You could however get the list of ID from the CycleFactory of a certain Release.
------
Example from API Documentation: ("Get filtered releases under a specified folder" example)
Set FolderFilter = relFactory.Filter

RelName = "Release*" 'Release 1, Release to QA, Release1.1, and so on.

'Get the list of the Releases in the folder that
' match "Release*"
FolderFilter.Filter("REL_NAME") = RelName
Set listOfReleases = FolderFilter.NewList
-----
You could get the ID list also using the API's Command object and running SQL something like below:
SELECT RCYC_ID, RCYC_NAME FROM RELEASE_CYCLES WHERE RCYC_NAME like '%UAT Test%'

This list of IDs could be then used in API filter.

Note: usage of Command object is only allowed for admin users by default. This can be change by Site Configuration however.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation