如何查询状态转换? [英] How to query for state transitions?

查看:38
本文介绍了如何查询状态转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取在特定日期内从一种状态转换到另一种状态(例如已提交到已修复)的缺陷.我在缺陷的修订历史记录中看到了该信息.在您的 WS API 中,它表示无法查询修订版.

I want to get defects that were transitioned from one state to another (for example Submitted to Fixed) within certain dates. I see that information in the revision history of the defect. In your WS API it says that revisions cannot be queried.

推荐答案

以下是 LookbackAPI 查询示例,用于查找状态在特定时间范围内从已提交"(及更高)更改为已修复"的缺陷:

Here is an example of LookbackAPI query that looks for defects whose state was changed from Submitted (and higher) to Fixed within a certain timeframe:

https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/12352608129/artifact/snapshot/query.js?find={"State":"Fixed","_PreviousValues.State":{$gte:"Submitted"},_ValidFrom:{$gte:"2013-06-01TZ",$lt:"2013-07-011TZ"}},sort:{_ValidFrom:-1}}&fields=true&hydrate=["_PreviousValues","State"]&pagesize:20

Lookback API 允许查看任何工作项或工作项集合在过去的样子.这与直接使用WS API 不同,它可以为您提供对象的当前状态,但没有历史数据.

Lookback API allows to see what any work item or collection of work items looked like in the past. This is different from using WS API directly, which can provide you with the current state of objects, but does not have historical data.

LBAPI 文档可在此处

附带说明,如果您查询缺陷并获取 RevisionHistory、Revisions 和 Description,并迭代结果解析STATE changed"的单个修订的描述,则可以在不使用 LBAPI 的情况下在自定义应用程序中获取状态转换数据字符串:

On a side note, it is possible to get state transition data in a custom app without using LBAPI if you query on defects and fetch RevisionHistory,Revisions and Description, and iterate over results parsing Description of individual revisions for "STATE changed" string:

if(results.mydefects[i].RevisionHistory.Revisions[j].Description.indexOf("STATE changed")>=0){ //....

但它可能既昂贵又低效.如果您决定这样做,请缩小缺陷查询的范围.

but it can be expensive and inefficient. If you decide to do that please narrow the scope of your defect query.

这篇关于如何查询状态转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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