使用Rally API根据functionselect用户故事

我正在尝试获取属于某个function但拥有子项的所有用户素材。

以下是我使用rally-node创build查询的方法。

async.map(features, function(feature, cb) { self.restApi.query({ type: 'hierarchicalrequirement', limit: Infinity, order: 'Rank', fetch: ['FormattedID', 'Name', 'Children'], parent: feature.ObjectID, query: queryUtils.where('DirectChildrenCount', '>', 0) }, cb); }, function(err, results) { //user stories }); 

以下是我的function如何:

  { _rallyAPIMajor: '2', _rallyAPIMinor: '0', _ref: 'https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature/18846103932', _refObjectUUID: 'c01d7f828-a6d6-4efc-8160-c0c19ad0fabc', _objectVersion: '7', _refObjectName: 'Dashboard Widgets', ObjectID: 18836103932, FormattedID: 'F1', DirectChildrenCount: 2, Name: 'Dashboard Widgets', UserStories: { _rallyAPIMajor: '2', _rallyAPIMinor: '0', _ref: 'https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature/18846103932/UserStories', _type: 'HierarchicalRequirement', Count: 2 }, _type: 'PortfolioItem/Feature' }, 

我是新来的集会,所以任何进一步的帮助关于文件等,真的很感激。

这里是一个完整的例子,其中Feature被查询,并且它的UserStories集合被获取并且然后被水合。

由于性能原因,v2.0删除了在相同响应中返回子集合的能力。 现在,获取集合将返回一个对象,其中包含从中获取集合数据的计数和url。 需要单独的请求来保存一个集合。

这个变化logging在这里

我不在你的文章中看到一个问题,我不知道你遇到了什么问题,但他的代码获取基于function的用户故事,通过('DirectChildrenCount', '>', 0)

 var rally = require('rally'), queryUtils = rally.util.query; mySettings = { apiKey: '_secret', server: 'https://rally1.rallydev.com', //this is the default and may be omitted requestOptions: { headers: { 'X-RallyIntegrationName': 'My cool node.js program', 'X-RallyIntegrationVendor': 'My company', 'X-RallyIntegrationVersion': '1.0' }, } }, restApi = rally(mySettings); function queryFeature() { return restApi.query({ type: 'portfolioitem/feature', fetch: ['FormattedID', 'Name', 'UserStories'], query: queryUtils.where('FormattedID', '=', 'F7') }); } function queryChildren(result) { return restApi.query({ ref: result.Results[0].UserStories, limit: Infinity, order: 'Rank', fetch: ['FormattedID', 'Name'], query: queryUtils.where('DirectChildrenCount', '>', 0) }); } function onSuccess(result) { console.log('Success!', result); } function onError(errors) { console.log('Failure!', errors); } queryFeature() .then(queryChildren) .then(onSuccess) .fail(onError);