It's all about the answers!

Ask a question

Getting ID of newly created test case using POST method


1
1
Chandrahasa Reddy D (5715160) | asked Nov 06 '12, 7:13 a.m.
Hi,
When I create new test case using POST method, is there any way to get the ID of newly created test case ?
Currently I am using RQMUrlUtility.jar and it gives output URL after post which does not contain test case ID:
ex: https://server:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/TestProject/testcase
which does not have ID..

Accepted answer


permanent link
Pramod Chandoria (2.1k11220) | answered Nov 08 '12, 12:14 a.m.
JAZZ DEVELOPER
You can do a GET again using the externalId generated
e.g. GET
https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality Manager/testcase/slug__G0QpcSibEeKeLMV6FKvWKw
with header

accept: application/xml

The response should contain the XML of the artifact. In the xml you can look for webId, that is the internal integer Id of the artifact created.

Chandrahasa Reddy D selected this answer as the correct answer

Comments
Paul Slauenwhite commented Nov 08 '12, 6:22 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Correct.

Note, the webId property is only supported for a subset (roughly half) of resources.

One other answer



permanent link
Paul Slauenwhite (8.4k12) | answered Nov 06 '12, 7:25 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
You would have to use another HTTP client that displays HTTP response headers since the resource ID is contained in the Content-Location header.

Comments
Chandrahasa Reddy D commented Nov 06 '12, 11:11 p.m.

It returns Generated ID something like this slug1SgOcSiQEeKeLMV6FKvWKw
I want RQM generated numeric ID. I am not sure if we can use this slug
1SgOcSiQEeKeLMV6FKvWKw for getting XML content of resource. Please suggest.


Paul Slauenwhite commented Nov 07 '12, 6:29 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

This is the generated external ID.  It can be the ID of the URL used to GET the resource XML.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.