how to use RQM REST API to get Test Case Execution Record links related to a specific Test case?
Hi Someone who may concern,
I tried to use RQM REST API to retrieve a specific test case and I want to parse the content to get TCER related to this test case. But I found there is no such info in test case:
https://[local host]/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/[project name]/testcase/[Test case number]
I tried to add "?calmlinks=true", it will return requirement link back, but I still can not find TCER links.
So I am wondering whether any other options should I configure to get Test Case Execution Record links related to a specific Test case?
Thanks!
Best Regards,
Jane Zhou
2 answers
The reason you don't see it is because the relationship goes in the other direction (from TCERs to test cases). What you'll need to do is use the "fields" parameter to query the TCER feed for the one that is associated with the test case you are interested in.
I didn't test this, but the syntax would be something like:
[public repo url]service/com.ibm.rqm.integration.service.IIntegrationService/resources/[project]/executionworkitem?fields=feed/entry/content/executionworkitem[testcase/@href='[testcase url]']/*
[public repo url]service/com.ibm.rqm.integration.service.IIntegrationService/resources/[project]/executionworkitem?fields=feed/entry/content/executionworkitem[testcase/@href='[testcase url]']/*
Here is the URL to find out Test Case Execution Record link of a specific test case
https://<host>:<port>/<contextRoot>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project area>/executionworkitem?fields=feed/entry/content/executionworkitem/testcase[(@href = '<testcase url>')]
And testcase url would be something like as below
https://<host>:<port>/<contextRoot>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<Project Area/testcase/urn:com.ibm.rqm:testcase:<Unique ID>
Comments
I don't think this is quite right. I think your query URL filters out all the properties of the executionworkitem except for the testcase property.
I don't think this is quite right. You are filtering out all the properties of the executionworkitem. You need to put the "testcase/" part inside the query part of the expression (as in my answer) to avoid selecting only the testcase property.