我需要使用HP ALM的OTA来筛选特定范围ID的缺陷。这需要在不从ALM调用所有缺陷并从代码中过滤它们的情况下完成,因为这会显著增加时间,这是不可取的。
例如,我可以如下过滤单个缺陷:
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);
有没有一种方法可以获得ID范围在1到100之间的Bug列表。类似这样的东西:
// Gets all the bugs between 1-100
OTDFilter["BG_BUG_ID_MIN"] = 1;
OTDFilter["BG_BUG_ID_MAX"] = 100;
OBugList = OBugFactory.NewList(OTDFilter.Text);
过滤1-100之间所有缺陷的完整解决方案如下:
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.;
OTDFilter.Text
的查询是通过首先在HP ALM Web应用程序中按ID筛选缺陷,然后复制筛选查询文本并粘贴到此处获得的。