It's all about the answers!

Ask a question

Can't create new executionworkitem (API PUT request)

Enrique Sánchez (434) | asked Jan 26 '22, 10:45 a.m.
edited Jan 26 '22, 11:49 a.m.
(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:


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:

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

permanent link
Enrique Sánchez (434) | answered Jan 27 '22, 10:20 a.m.

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

Ralph Schoon selected this answer as the correct answer

2 other answers

permanent link
Ralph Schoon (63.3k33646) | answered Jan 27 '22, 3:13 a.m.

 PUT is always only used for update operations. The API complains that the ID of the item to update is missing and likely rightly so.

POST is usually the request type that is used to create a new item. I do not know if the API you are using supports POST.

permanent link
Enrique Sánchez (434) | answered Jan 27 '22, 3:36 a.m.

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:


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:


Ralph Schoon commented Jan 27 '22, 4:45 a.m.

 The documentation for the REPORTABLE REST API of ETM can be found here:

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.

Ralph Schoon commented Jan 27 '22, 4:46 a.m.

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.