我在java中使用了。我正在尝试获取历史数据特性,我正在使用的示例代码如下所示。
LookbackApi lookbackApi = new LookbackApi();
lookbackApi.setCredentials("username", "password");
lookbackApi.setWorkspace(47903209423);
lookbackApi.setServer("https://rally1.rallydev.com");
//lookbackApi.setWorkspace("90432948");
LookbackQuery query = lookbackApi.newSnapshotQuery();
query.addFindClause("_TypeHierarchy", "PortfolioItem/Feature");
query.setPagesize(200) // set pagesize to 200 instead of the default 20k
.setStart(200) // ask for the second page of data
.requireFields("ScheduleState", // A useful set of fields for defects, add any others you may want
"ObjectID",
"State",
"Project",
"PlanEstimate",
"_ValidFrom",
"_ValidTo")
.sortBy("_UnformattedID")
.hydrateFields("ScheduleState","State", "PlanEstimate","Project"); // ScheduleState will come back as an OID if it doesn't get hydrated
LookbackResult resultSet = query.execute();
int resultCount = resultSet.Results.size();
Map<String,Object> firstSnapshot = resultSet.Results.get(0);
Iterator<Map<String,Object>> iterator = resultSet.getResultsIterator();
while (iterator.hasNext()) {
Map<String, Object> snapshot = iterator.next();
}我需要一种方法来放置一个条件,这样它将从历史中获取所有的记录,这些记录将被计划估计更改,但是对于任何特性和潜在的用户故事,它将忽略其他历史记录。我需要这样做,以便我们可以跟踪计划估计的变化,但,将能够避免获取不必要的数据,并减少时间这样做。
发布于 2015-02-26 03:59:20
我不太熟悉java工具包,但是使用原始的Lookback API,您可以使用像{"_PreviousValues.PlanEstimate": {"$exists": true}}这样的filter子句来完成这个任务。
发布于 2015-03-02 06:07:38
Map ifExist = new HashMap();
ifExist.put("$exists", true);
// Note:- true is java boolean, be careful with this as string "true" will not work.
query.addFindClause("_PreviousValues.PlanEstimate",ifExist);另外,还需要考虑在.requireFields()中添加"PlanEstimate“,以防只需要”PlanEstimate“水化。
https://stackoverflow.com/questions/28733371
复制相似问题