0

I need to filter the defects for a certain range of ID's from HP ALM using its OTA. This needs to be done without calling all the defects from ALM and filtering them from code as that would significantly increase the time which is not desirable.

For example, I can filter a single defect as follows:

        TDAPIOLELib.BugFactory OBugFactory = alm_core.tDConnection.BugFactory as TDAPIOLELib.BugFactory;
        TDAPIOLELib.TDFilter OTDFilter = OBugFactory.Filter as TDAPIOLELib.TDFilter;
        TDAPIOLELib.List OBugList;
       
        // Gets only the bug with ID 3
        OTDFilter["BG_BUG_ID"] = 3;

        OBugList = OBugFactory.NewList(OTDFilter.Text);
       

Is there a way to get the Bug List in an ID range between 1 to 100. Something like this:

        // Gets all the bugs between 1-100
        OTDFilter["BG_BUG_ID_MIN"] = 1;
        OTDFilter["BG_BUG_ID_MAX"] = 100;

        OBugList = OBugFactory.NewList(OTDFilter.Text);
  • I think is is check for a string not a number. See : https://community.softwaregrp.com/dcvta86296/attachments/dcvta86296/itrc-895/28622/3/program.txt?force_isolation=true – jdweng Apr 22 '21 at 15:08
  • @jdweng Are you implying it takes a string query? If so, what is the format of the query to extract the IDs in that range. – Shashwat Swain Apr 23 '21 at 02:56
  • The values 1, and 100 and numbers. If the database is using strings then you need "1" and "100". – jdweng Apr 23 '21 at 09:14
  • The database uses numbers to filter(as shown in the first snippet of code) but I have no idea in which way to write the query. The official documentation does not have any detailed mention of it either. – Shashwat Swain Apr 25 '21 at 10:13
  • 1
    Try a wildcard *. See : https://www.guru99.com/hp-alm-gui.html – jdweng Apr 25 '21 at 10:36

1 Answers1

0

The complete solution to filter all the defects between 1-100 is as follows:

TDAPIOLELib.BugFactory OBugFactory = alm_core.tDConnection.BugFactory as TDAPIOLELib.BugFactory;
TDAPIOLELib.TDFilter OTDFilter = OBugFactory.Filter as TDAPIOLELib.TDFilter;
TDAPIOLELib.List OBugList;
List<DefectOutputModel> AllBugList = new List<DefectOutputModel>();
    OTDFilter.Text= @"[Filter]{
                                TableName: BUG,
                                ColumnName: BG_BUG_ID,
                                LogicalFilter: "">= 1 And <= 100"",
                                VisualFilter: "">= 1 And <= 100"",
                                SortOrder: 1,
                                SortDirection: 0,
                                NO_CASE:
                            }";
    OBugList = OBugFactory.NewList(OTDFilter.;

The query for OTDFilter.Text was obtained by first filtering the defects by ID in HP ALM webapp and then copying the filter query text and pasting it here.