简体   繁体   English

计数聚合与从Rest API返回的数据不匹配

[英]Count aggregate does not match data returned from Rest api

I did look at existing question Aggregation doesn't seem to match data in the VersionOne RESTful API 我确实查看了现有问题, 聚合似乎与VersionOne RESTful API中的数据不匹配

and I still have a issue. 而且我还有一个问题。

rest-1.v1/Data/Epic/9549/SubsAndDown:Story[AssetState!='Dead'].@Count

- Above query returns 182 as # of stories in a given epic. -上面的查询以给定史诗中的故事数形式返回182。

rest-1.v1/Data/Epic/9549/SubsAndDown:Story[AssetState!='Dead']

- However when I actually want to get all the story ids , I can only see 149 stories , I don't understand what happened to those missing 33 stories as I am using correct assestState. -但是,当我实际上想要获取所有故事ID时,我只能看到149个故事,因为我使用正确的assestState,所以我不明白那些丢失的33个故事发生了什么。

One more example: 再举一个例子:

from: Epic
filter:
- Name=""{0}""
select:
- Name
- Scope.Name
- Status.Name
- SubsAndDown:Story[AssetState!='Dead'].@Count
- SubsAndDown:Story[AssetState!='Dead'&Estimate=''].@Count
- SubsAndDown:Story[AssetState!='Dead'&Estimate>='0'].@Count

Above query returns count as 182, 49, 133 respectively, 上面的查询返回的计数分别为182、49和133,

However when I actually counted the data returned [ie counting stories returned ] I got 149, 26, 123 respectively. 但是,当我实际计算返回的数据(即计算返回的故事)时,我分别得到了149、26和123。

Does anyone have idea of whats happening here? 有人知道这里发生了什么吗? Why doesn't count and data returned match? 为什么不计数并且返回的数据匹配?

You may be excluding the Story workitems in the parent Epic. 您可能会排除父级Epic中的Story工作项。

Instead of SubsAndDown, try using SubsMeAndDown like this: 尝试使用SubsMeAndDown代替SubsAndDown,如下所示:

rest-1.v1/Data/Epic/9549/SubsMeAndDown:Story[AssetState!='Dead'].@Count

That should include stories that are associated with the parent Epic. 这应该包括与父级Epic相关的故事。

I believe the discrepancy you are seeing is the result of member-based project access restrictions. 我相信您看到的差异是基于成员的项目访问限制的结果。 The @Count summation is counting all stories that exist within that epic and state, but when you query for the list of individual stories, it is only listing the ones you have permission to see. @Count总和计数该史诗和状态中存在的所有故事,但是当您查询单个故事的列表时,它仅列出您有权查看的故事。 An epic can contain stories that are themselves part of different projects. 史诗可以包含本身属于不同项目的故事。 If you have access to some of those projects but not to others, you will see results along these lines. 如果您有权访问其中一些项目,但无权访问其他项目,则将看到符合这些要求的结果。

You could test this by limiting your count to stories belonging to a project to which you know you have access: 您可以通过将计数限制为属于您知道有权访问的项目的故事来进行测试:

rest-1.v1/Data/Epic/9549/SubsAndDown:Story[AssetState!='Dead';Scope='Scope:{some scope id}'].@Count

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM