关于通过Rally API获取指定迭代燃尽数据的技术求助
Got it, let's break down how to pull the burndown data you need from Rally's REST API—since the built-in charts are just using this same under-the-hood data, you absolutely can grab it to build your own graphs. Here's a step-by-step approach:
1. 先获取目标迭代的核心信息
First, you need to fetch the iteration's details to get its date range and unique ID, which you'll use to filter related work items. Use this API call:
GET /slm/webservice/v2.0/Iteration?query=(Name = "你的迭代名称")&fetch=StartDate,EndDate,ObjectID&workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/[你的工作区ID]
- Replace
你的迭代名称with the exact name of your sprint/iteration. - Swap
[你的工作区ID]with your Rally workspace's ObjectID (you can find this in the workspace settings URL). - This returns the iteration's start/end dates and ObjectID—hold onto these for the next steps.
2. 提取迭代下的工作项及状态变更历史
Next, pull all the work items (user stories, defects, etc.) tied to the iteration, along with their effort estimates and state change history. For user stories, use this call:
GET /slm/webservice/v2.0/HierarchicalRequirement?query=(Iteration.ObjectID = [迭代的ObjectID])&fetch=PlanEstimate,ScheduleState,RevisionHistory&workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/[你的工作区ID]
- For defects, replace
HierarchicalRequirementwithDefect. - The
RevisionHistoryfield is critical here—it contains every state change timestamp for each work item, which you'll need to calculate daily remaining effort.
3. 解析数据生成燃尽点
Once you have the raw data, you'll need to process it to build your burndown dataset:
- For each work item, iterate through its
RevisionHistoryentries to find when itsScheduleStatechanged (e.g., fromDefinedtoIn-ProgresstoDone). - Map each state to a remaining effort value based on your team's burndown rules (e.g.,
Done= 0 remaining,In-Progress= 50% of original estimate, or whatever your team uses). - For each day in the iteration's date range, sum up the remaining effort across all work items to get that day's burndown value.
认证注意事项
Don't forget to authenticate your API requests:
- Use an API Key: Add an
Authorizationheader withApiKey [你的API密钥]. - Or use session auth: Log in via the API first to get a
ZSESSIONIDcookie, then include it in subsequent requests.
小提示
- If you need to include other work item types (like tasks), adjust the endpoint to
Taskand fetchRemainingEstimateinstead ofPlanEstimate. - Rally's API has rate limits, so batch requests if you're pulling data for large iterations.
内容的提问来源于stack exchange,提问作者Abhijeet Kumar

