Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

rally - How to query for state transitions?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 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 documentation is available here

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...