简体   繁体   English

无法使用文件夹名称字段来过滤HP QC REST API中的资源

[英]Cannot use folder-name field to filter resources in HP QC REST API

I don't expect to get an answer on this but if anyone can help it would be greatly appreciated. 我不希望对此有任何答案,但是如果有人可以提供帮助,将不胜感激。

We're using HP Application Lifecycle Management 12.2 (ALM or QC/QualityCenter as it's called). 我们正在使用HP Application Lifecycle Management 12.2(称为ALM或QC / QualityCenter)。 I'm trying to retrieve test resources from the project using the REST api but I suspect I've come across a defect in the API. 我正在尝试使用REST API从项目中检索测试资源,但我怀疑我在API中遇到了缺陷。

I'm trying to filter the response by using a query, and any other query works fine but when I try to use the 'folder-name' field it fails with the following message: 我正在尝试使用查询来过滤响应,并且其他任何查询都可以正常工作,但是当我尝试使用“文件夹名称”字段时,它失败并显示以下消息:

Failed to set params in the parametrized query 无法在参数化查询中设置参数

It doesn't matter what format I try to escape the query with, I've tried the following: /resources/?query={folder-name[%27folder%27]} /resources/?query={folder-name['folder']} /resources/?query=%7bfolder-name%5b%27folder%27%5d%7d 尝试使用哪种格式转义查询都无关紧要,我尝试了以下方法: /resources/?query={folder-name[%27folder%27]} /resources/?query={folder-name['folder']} /resources/?query=%7bfolder-name%5b%27folder%27%5d%7d

I've also reproduced this on an 11.52 QC instance so it's not just our environment. 我还在11.52 QC实例上重现了此内容,因此它不仅是我们的环境。 I've double checked the customization collection using the ?can-filter=true param and folder-name is supposed to be filterable. 我已经使用?can-filter = true参数仔细检查了定制集合,并且Folder-name应该是可过滤的。

I'm currently using the parent-id for filtering instead which works but it requires me to do another request to get the parent-id first which I would like to refrain from. 我目前正在使用parent-id进行过滤,但它可以正常工作,但是它要求我再次请求获取我想避免的parent-id。

Any suggestions, patches? 有什么建议,补丁吗? Thanks 谢谢

As I wrote in the comments, the error is reproducable here, and I agree that it is strange. 正如我在评论中所写,这里的错误是可重现的,我同意这很奇怪。 The folder-name exists as a field in resource, and should be filterable. 文件夹名称在资源中作为字段存在,并且应该是可过滤的。 It seems to be a bug. 这似乎是一个错误。

But there is another approach that I offer as a substitute solution. 但是,我提供了另一种方法作为替代解决方案。 The resource entity offer a relation directly to the folder entity, and you can get the exact result you were looking for, by using a cross join with that table: 资源实体直接提供与文件夹实体的关系,通过对该表使用交叉联接,您可以获得所需的确切结果:

/resources/?query={resource-folder.name['folder']}

This is probably too late to help you with your work, but it might help others. 这可能为时已晚,无法帮助您完成工作,但可能会帮助其他人。

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

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