It's all about the answers!

Ask a question

How to use PUTMethod to change the testplan approve status using RQM restful api?

yixin wang (1111) | asked Aug 19 '13, 2:58 a.m.
We have a requirement to allow the approver to approve the test plan out of RQM web UI.We want to change the Status from pending to approved:
1) RQM version:4.0.1
2)We use PUT to change the status and PUTMethod url:  https://<rqm server="">:9443/qm/service/<project name="">/testplan/
3)We first use GETMethod to obtain the responseBody data of url as above, and output the data to a xml file.We change the file:    <ns2:approvalstatus> </ns2:approvalstatus> (:Old)
to <ns2:approvalstatus> </ns2:approvalstatus> (:New).
than we put the file as requestBody to url: put.setRequestBody(new FileRequestEntity(file,"text/xml; charset=utf-8")); and the response is 200.

In our java code we login as the approver  first with j_security_check , and then use PUT to only update one approver approve status, we found whatever we want to change the approve status to(e.g. approved, rejected), the actual result is : it is changed to status 'pending'. That means if the approve status is rejected, after our code run, it is changed to 'pending'.
This is why? does we use wrong data format? 
The question is also describe in:

One answer

permanent link
Paul Slauenwhite (8.4k12) | answered Aug 19 '13, 9:08 a.m.
edited Aug 19 '13, 10:14 a.m.
When using the RQM Reportable REST API to update the approval status, you must be authenticated with the RQM server using the same user credentials as the approval owner.

I have tested this in RQM 4.0.1 using Poster and/or HttpRequester.

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.