这是一半VBA和一半VersionOne问题。我正在使用VersionOne数据API来检索估计,详细估计,完成(实际)和故事或缺陷待办事项的聚合值。
我正在使用以下查询:
rest-1.v1/Data/PrimaryWorkitem?sel= Children[AssetState!='Dead'].Actuals.Value.@Sum,Children.DetailEstimate.@Sum,Children.EstimatedDone.@Sum,Children.ToDo.@Sum,Children.Actuals.Value.@Sum,ID.Number,Super.Super.Reference&where=Scope.ParentMeAndUp.Name='XXX Project';Scope.IsClosed='false'
使用上述内容,我成功获得了以下响应:
<Asset href="/VersionOne/rest-1.v1/Data/Story/822392" id="Story:822392">
<Attribute name="Children[AssetState!='Dead'].Actuals.Value.@Sum">144</Attribute>
<Attribute name="Children.DetailEstimate.@Sum">136</Attribute>
<Attribute name="Children.EstimatedDone.@Sum">136</Attribute>
<Attribute name="Children.ToDo.@Sum">0</Attribute>
<Attribute name="Children.Actuals.Value.@Sum">148</Attribute>
<Attribute name="ID.Number">S-25603</Attribute>
<Attribute name="Super.Super.Reference" />
然后我使用下面的VBA脚本将这些结果导出到Excel中。
.Cells(irow, EstDonelCol).Value = assets(i).SelectSingleNode("Attribute[@name='Children.EstimatedDone.@Sum']").Text
.Cells(irow, DetailEstCol).Value = assets(i).SelectSingleNode("Attribute[@name='Children.DetailEstimate.@Sum']").Text
.Cells(irow, ToDoCol).Value = assets(i).SelectSingleNode("Attribute[@name='Children.ToDo.@Sum']").Text
.Cells(irow, DoneActualsCol).Value = assets(i).SelectSingleNode("Attribute[@name='Children[AssetState!='Dead'].Actuals.Value.@Sum']").Text
上述所有行都不是最后一行。上面的脚本不会返回'Children [AssetState!='Dead']的任何值.Actacts.Value。@ Sum']“)。Text。
我应该看到返回的值为144。有什么东西显而易见吗?