It's all about the answers!

Ask a question

How to update rqm testcaseresults with REST-Api?

Emil Cavani (1123) | asked Aug 07 '18, 5:03 a.m.
edited Aug 07 '18, 8:14 a.m.


I have a testsuite that executes my script that reads a csv file with testcasenames and their new state(failed, blocked, passed) and i want to update all of the testcases from the testsuite with a PUT call.
What i need:
  • The url to update a testcaseresult
  • The headers of the PUT call

Thanks in advance,

Emil Cavani

One answer

permanent link
Paul Slauenwhite (8.4k12) | answered Aug 07 '18, 7:47 a.m.

Emil Cavani commented Aug 07 '18, 8:19 a.m.

ok thanks, but can you tell me how i put authorization credentials into the header?

Paul Slauenwhite commented Aug 07 '18, 11:45 a.m.

Hi Emil,

I would suggest looking at (or using) the source code from one of applications (see

Emil Cavani commented Aug 08 '18, 7:03 a.m.

I studied your suggested page and tried to get the ressourcexml.

My url: 
https:/{host}/qm/service/ QM/testcase/ 
with Accept header with value: application/xml

But the response is no xml, but the rqmwebpage of the testcase.

So please tell me how to retrieve the resourcexml of a testcase, or something like that.

Emil Cavani commented Aug 08 '18, 9:23 a.m.

Ok the good thing is, that i figured out, that you can´t get xml representations of testcases. The bad thing is when i tried to get the xml of my executionresult it worked, but i want to update the state of it, so i made a put request with the same url and added the header IsMatch. I assigned the value of the header with the state id of the xml (_3OPykpmAEeiWE6r_3f0nZA). But the response is error 412 precondition failed and the body contains the answer to the error: State identifier _3OPykpmAEeiWE6r_3f0nZA is stale.  But what does this mean and what id should i take instead?

Paul Slauenwhite commented Sep 06 '18, 7:48 a.m.

Apologies for the delayed response.

Yes, you can GET the XML representation of test cases.  In your case, there may be an authentication issue, rerouting your GET request to the web UI login page.  What HTTP client are you using?  I would suggest using one of the HTTP clients listed at

For your PUT (update) request, it appears that there was any update to the test case result after your GET response and before you PUT request.  In this case, retry the steps (GET, update, PUT) again.

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.