查询以从父项和子项中检索缺陷 [英] Query to retrieve defects from parent and children
问题描述
我继承了显示项目缺陷图的代码.我现在已经把我的项目分成了两个项目,所以现在有一个父项目和两个孩子.代码(如下)只是累积了父级的缺陷,不包括子级的数据.
I have inherited code that displays a graph of defects on a project. I have now took my project and split it into two projects, so that now there is a parent project and two children. The code (below) just accumulates the defects from the parent and does not include the data from the children.
片段:
storeType: "Rally.data.lookback.SnapshotStore",
storeConfig: {
find: { _TypeHierarchy: "Defect", Children: null },
fetch: ["Severity", "State"], hydrate: ["Severity", "State"],
sort: { _ValidFrom: 1 },
filters: [{ property: "Project", value: context.getProject().ObjectID }, { property: "_TypeHierarchy", value: "Defect" }, { property: "Children", value: null}] },
所以我很确定问题出在value: context.getProject().ObjectID"这一部分,因为它说从当前项目(而不是它的子项目)获取数据.我怎样才能完成我需要的事情?
So I'm pretty sure the problem is in this part "value: context.getProject().ObjectID" as it says to get the data from the current project (and not its children). How can I accomplish what I need?
推荐答案
不确定您是要从 Rally 获取回顾(时间序列)数据还是当前 (WSAPI) 数据.您的代码意味着回溯,所以我会考虑到这一点来回答.
Not sure if you're intending to get lookback (time series) data or current (WSAPI) data from Rally. Your code implies lookback so I will answer with that in mind.
您可以尝试添加到您的 find 子句(并删除当前的项目过滤器):
You could try adding to your find clause (and removing the current Project filter):
"_ProjectHierarchy": { $in : [123] }
"_ProjectHierarchy": { $in : [123] }
其中 123 是您的父项目的对象 ID.这应该会导致在层次结构中包含您的父项目的任何项目的缺陷.
where 123 is the object id of your parent project. That should get defects from any projects that include you parent project in the hierarchy.
这篇关于查询以从父项和子项中检索缺陷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!