Can't create new executionworkitem (API PUT request)
(using Quality Management 7.0.2)
I'm trying to use the same procedure that I use to create a new execution result, in which I make a PUT request to the following URL:
https://<url>:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<area>/executionresult
with the XML contents of the new execution request that I want to create and it works OK.
But if I try to create a new execution record with:
https://<url>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<area>/executionworkitem
I get a 400 (bad request) response, with the message: "No se puede crear o actualizar un recurso de tipo executionworkitem con un ID que falta"
(Spanish) that means: can't create or update a resource of type executionworkitem with a missing ID.
But the ID should be automatically created like when I create an execution result, so, what could be the problem?
I've also tried to add an ID to the end of the URL (e.g. executionworkitem/2) but it does not work,
the response in that case is an XML with the first executionworkitem.
Instead of my custom XML I've also tried to upload an XML from an existing executionworkitem with the same result.
Accepted answer
Thanks for the links.
It turns out I was wrong in one of my assumptions, since I was trying to create an executionworkitem for a test case that already had an executionworkitem.
It only works if the test case has no executionworkitem associated to it.
Apart from that, the original request works by using a POST.
PUT can also be used if the identifier is specified at the end of the URL, like executionworkitem/myworkitem
2 other answers
When I send a POST request to the executionworkitem URL, no new element is created.
I receive a 200 reply, but its contents are the XML of the first existing executionworkitem:
executionworkitem/urn:com.ibm.rqm:executionworkitem:1
The XML that I try to upload includes the title and related testcase.
If I remove the testcase, the error shown is:
AQXEX5062E The resource "title" can't be created because the referenced test case does not exist in the server.
But it contains the URL of an existing test case.
Here is the XML I am using:
Thanks
Comments
The documentation for the REPORTABLE REST API of ETM can be found here: https://jazz.net/wiki/bin/view/Main/RqmApi
This includes what methods might and might not be supported, required headers etc. I have not played with that API that much, but I assume it is for reporting and if creating items is possible it should be documented here for which items.
Getting a 200 back does not mean anything. If you make a request without being logged in, you can get a 200 back and response contains HTML that complains about java script, dependent on the redirection policies.
I don't know the API, so I can't debug your stuff.
Getting a 200 back does not mean anything. If you make a request without being logged in, you can get a 200 back and response contains HTML that complains about java script, dependent on the redirection policies.
I don't know the API, so I can't debug your stuff.
POST is documented here: https://jazz.net/wiki/bin/view/Main/RqmApi#HTTP_PUT_POST_Requests