| || |
Mercury QC OTA Bug Filter Examples
I am using a bug filter in Mercurty QC through the bugfactory object:
bugfilter.Filter("BG_STATUS") = "Closed"
bugfilter.Order("BG_PRIORITY") = 1
The example from the helpfile works, but I need to set the criteria to find a range of values, not just a single one. For example, bugfilter.Filter("BG_USER_21") = "project123"
would return that record or others that matched that particular criteria, but what if I needed the search to return all other defects with similar but different project names, such as "project 123a" or "project 123b."
Does someone have an example of a bug filter that has the ability to return multiple matches for a particular field?
A sample in VB code would be appreciated.
Re: Mercury QC OTA Bug Filter Examples
Just repeat the call to the filter method for each of the fields you want to filter on. Subsequent calls do not replace the filter but add to it. If you want multiple matches for a single field just add the or condition in the criteria eg
bugFilter.Filter("BG_STATUS") = "Closed OR Deferred"
Basically the criteria can be anything the UI can handle eg wildcards. I'll sometimes get my filter correct in the UI and then copy it into VB. You just need to be careful where you need to include quotes as per your "project 123a" example above as you'll have to do something like
bugFilter.Filter("BG_USER_21") = """" & "project 123a" & """" & " or " & """" & "proj ....
or it could just be """ to get a quote in a string, I can never remember.