使用 Rally API 通过迭代获取用户故事 [英] Fetch user stories by iteration using Rally API

查看:37
本文介绍了使用 Rally API 通过迭代获取用户故事的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何在 Rally 中获取一个用户故事的所有字段.现在,我需要获取最后 5 次迭代,并计算每次迭代的完成点.

I can't figure out how to fetch all the fields of one User story in Rally. Right now, I need to fetch last 5 iterations, and calculate done points for every iteration.

我设法通过指定type:iteration来获取迭代,但不知道如何获取这些迭代的用户故事,以及如何指定仅完成.我应该使用与用户故事相关的任务的 TaskStatus 吗?

I managed to fetch iterations, by specifying type: iteration, but don't know how to fetch user stories for those iterations, and how to specify only done. Should I go with TaskStatus of tasks associated with User story?

我猜用户故事参考了迭代,但我不确定它是什么样子.我觉得这个手册不是很简洁,还有其他文档吗我应该使用什么?

I guess that User story has reference on Iteration, but I'm not sure how it looks like. I don't find this manual very concise, is there any other docs that I should use?

我看到在 HierarchicalRequirement 中,我有具有以下字段的 Iteration 对象:

I see that within HierarchicalRequirement, I have Iteration object with following fields:

_rallyAPIMajor: 2
_rallyAPIMinor: 0
_ref:   https://rally1.rallydev.com/slm/webservice/v2.0/iteration/18831411089
_refObjectUUID: 8053fbd0-867c-4126-805c-18ccbc958a93
_refObjectName: Iteration 1
_type:  Iteration

问题:我应该如何使用它?我想获取 5 次迭代(按 EndDate 排序),然后为每次迭代获取所有任务.但我不确定如何为此指定查询(该任务属于迭代).这个问题可能听起来很愚蠢,但我仍然在暗中拍摄 Rally.关于完成要求,我是否应该只获取那些 TaskStatus 已完成的要求?

Question: How I should use this? I was thinking to fetch 5 iterations (ordered by EndDate), and then to fetch all tasks for every iteration. But I'm not sure how to specify query for that (that task belongs to iteration). This question may sound silly, but I'm still shooting in the dark with Rally. Regarding Done requirements, should I fetch only those for whom TaskStatus is Completed?

推荐答案

Rally 对象模型在 Web 服务 API 文档.

Rally object model is available in Web Services API documentation.

在 HierarchicalRequirement(用户故事)对象上有 Iteration 属性,它是对 Iteration 对象的引用,因此可以通过迭代来查询故事.

There is Iteration attribute on HierarchicalRequirement (user story) object, which is a reference to Iteration object, so it is possible to query stories by iteration.

您引用的手册特定于 LookbackAPI,并且需要熟悉WS API 文档中的对象模型.

The manual you referenced is specific to LookbackAPI, and requires familiarity with the object model in WS API documentation.

这是一个 LookbackAPI 端点,用于查询计划进行三个迭代之一的用户故事,其中 222,333,444 是迭代的 ObjectID:

Here is a LookbackAPI endpoint that queries user stories that scheduled for one of three iterations, where 222,333,444 are ObjectIDs of iterations:

"Iteration" : {$in: [222,333,444]} 

并获取 'FormattedID','ScheduleState','PlanEstimate' 用户故事字段.

and fetches 'FormattedID','ScheduleState','PlanEstimate' user story fields.

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/111/artifact/snapshot/query.js?find={"Iteration" : {$in: [222,333,444]},"_TypeHierarchy":"HierarchicalRequirement","__At" : "current"}&fields=['FormattedID','ScheduleState','PlanEstimate'],hydrate=['ScheduleState']

这是一个类似的 WS API 端点:

Here is a similar WS API endpoint:

https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1119&query=(((Iteration.ObjectID = 222) OR (Iteration.ObjectID = 333)) OR (Iteration.ObjectID = 444))&fetch=FormattedID,ScheduleState,PlanEstimate&pagesize=200

两个查询返回相同的结果.

Two queries return the same results.

即使您想获取对象的当前状态,您也可以使用 Lookback API 查询而不是 WS API 查询,如上面使用 "__At" : "current" 的示例,但 Lookback API 是旨在提供历史数据.WS API 只返回对象的当前状态,而 Lookback API 可以及时返回这些对象的快照.

You may use Lookback API queries instead of WS API queries even if you want to get current state of objects, as in the example above using "__At" : "current", but Lookback API is designed to give historic data. WS API returns only current state of objects, while Lookback API can return snapshots of those objects in time.

rally-node没有有内置支持用于回溯 API.

rally-node does not have a built-in support for Lookback API.

这是一个集会节点示例,通过 3 次迭代查询故事:

Here is a rally-node example that queries for stories by 3 iterations:

var rally = require('rally'),
    queryUtils = rally.util.query;
    mySettings = {
        apiKey: '_XYZ...',
        server: 'https://rally1.rallydev.com',  //this is the default 
        requestOptions: {
            headers: {
                'X-RallyIntegrationName': 'stories by iteration node.js program',  
                'X-RallyIntegrationVendor': 'My company'
                'X-RallyIntegrationVersion': '1.0'                    
            },    
        }
    },
    restApi = rally(mySettings);

var q = queryUtils.where('Iteration.ObjectID', '=', 222).or('Iteration.ObjectID', '=', 333).or('Iteration.ObjectID', '=', 444);

restApi.query({
    type: 'hierarchicalrequirement'
    fetch: ['FormattedID', 'Name', 'ScheduleState', 'PlanEstimate', 'Iteration'], 
    query: q, 
    scope: {
        workspace: '/workspace/111', 
    },
}, function(error, result) {
    if(error) {
        console.log(error);
    } else {
        console.log(result.Results);
    }
});

这篇关于使用 Rally API 通过迭代获取用户故事的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆