How to approve a test plan using RQM Restful API?
We have a requirement to allow the approver to approve the test plan out of RQM web UI. Now we we query the approver information by such URL: https://<rqm server>:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/reources/<project name>/testplan?fields=feed/entry/content/testplan
[title='Test Plan sample 1']/approvals,
However we fail to modify the status by PUT method with the same URL. We tried to submit the same body GETted by above URL(with different approval status), but find the approval status didn't change.
Do we need to use test plan resource URL such as https://<rqm server>:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/reources/<project name>/testplan/urn:com.ibm.rqm:testplan:6? If so how about the content-type, and the http body format? We tried but also failed.
|
Accepted answer
Paul Slauenwhite (8.4k●1●2)
| answered Aug 19 '13, 9:08 a.m.
FORUM MODERATOR / JAZZ DEVELOPER 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. haibo zou selected this answer as the correct answer
|
5 other answers
Hi Haibo,
It looks like the state property is available for this operation - It is listed under Test Plan resource: https://jazz.net/wiki/bin/view/Main/RqmApi#Resources_and_their_Supported_Op You would need to use test plan resource URL to update the state property. However, I would like to know what error messages are you getting? Are you getting the 400 Bad Request error, or something else? Cheers, Will |
More information:
1) RQM version is 4.0.1 2) In our 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'. 3) we verified that RQM api can only modify the approve status of logging, not other approvers. This is good for us. ps:the format we change in code <ns2:approvalStatus>com.ibm.team.workitem.approvalState.approved </ns2:approvalStatus> <ns2:approvalStateChangedDate>2013-08-16T07:28:13.889Z </ns2:approvalStateChangedDate> |
Hi experts,
Is there any error with the call of RQM restful API? Or Is that a defect of RQM?
|
Thanks Paul for the support! With the kindly help, finally we resolved the issue successfully.
The content of http body which we pasted above is correct. However, we 'format' it after we GET the test plan and update the approval status. The 'format' operation add <lr> at the end of each line, which is not actually supported by RQM server. The RQM server then set the approval status to pending no matter what status it was. That's what the trouble we had;
2) the
|
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.