我在C#中使用REST API从HP / ALM中检索测试数据。我可以找到测试运行并将它们链接回测试用例,但是我很难获得链接的缺陷。
我可以通过
自行获取缺陷http://<alm-url>/qcbin/rest/domains/<domain>/projects/<project>/defects?query={detected-in-rcyc[=<cycle id>]}
但是,当我尝试按照测试运行的链接时:
.../defects/<defect-id>/defect-links
我没有得到任何东西。我注意到GUI有两个用于缺陷链接实体的选项卡:&#34;缺陷&#34;和&#34;其他&#34;。还有另一个查询来获取&#34;其他&#34;链接?我在
中的实体列表中看不到任何明显的内容.../customization/entities
我正在使用HP / ALM 11.00。
感谢。
答案 0 :(得分:0)
我刚刚在 ALM 11补丁19 验证了它。
我做了什么?
创建了缺陷 - 缺陷1。
创建了一个要求 - 要求1。
创建了一个测试 - test1。
将requirement1和test1链接到defect1。
然后调用此REST API:
的http:// {YOUR_SERVER:your_port} / qcbin /休息/域/ {your_domain替换} /项目/ {your_project} /缺陷/ {your_defect_id} /缺陷链接
得到了答复:
<defect-links>
<defect-link>
<comment/>
<creation-time>2016-08-09</creation-time>
<first-endpoint-id xsi:type="xs:int">1</first-endpoint-id>
<id xsi:type="xs:int">1</id>
<owner>sa</owner>
<second-endpoint-id xsi:type="xs:int">1</second-endpoint-id>
<second-endpoint-name>Test1</second-endpoint-name>
<second-endpoint-status>No Run</second-endpoint-status>
<second-endpoint-type>test</second-endpoint-type>
</defect-link>
<defect-link>
<comment/>
<creation-time>2016-08-09</creation-time>
<first-endpoint-id xsi:type="xs:int">1</first-endpoint-id>
<id xsi:type="xs:int">7</id>
<owner>sa</owner>
<second-endpoint-id xsi:type="xs:int">3</second-endpoint-id>
<second-endpoint-name>req1</second-endpoint-name>
<second-endpoint-status>Not Covered</second-endpoint-status>
<second-endpoint-type>requirement</second-endpoint-type>
</defect-link>
</defect-links>
看起来资源 / defect-links 会返回所有类型的链接。 至少可以通过 second-endpoint-type 属性过滤此结果。
老实说,不知道这个API如何在其他ALM版本/补丁上运行。