RQM REST API - PUT Request
CLM 5.0.1
We used to work in CLM 4.0.4 with the RQMUrlUtility to update Test Results (GET+PUT).
Recently, we have upgrade to CLM 5.0.1. The PUT command is broken. We receive error 400 as stated in https://jazz.net/wiki/bin/view/Main/RqmApi#PUT_requests.
We do not have an external ID. So PUT is no longer usable for us. POST command is also not usable as we want to update test result, not to create a new one.
Please advice,
Liora
|
2 answers
Hi Liora,
Please try using the HTTPRequester/Poster Firefox plug-ins. Also, what is the response content with the 400 (Bad Request) response? See https://jazz.net/wiki/bin/view/Main/RqmApi#Troubleshooting for more details. Comments
Liora Milbaum
commented Nov 02 '14, 8:20 a.m.
Hi Paul,
Your suggestion helped a lot. I've looked at the log. It was a license issue. Fixed it.
BUT, I hit another issue. I extracted the XML file with the GET command, updated the XML file and tried to update the resource with the PUT command.
The PUT command fails with error 412. The log file states that I am running the command with user - 'jennyt'. I issue the PUT command with user 'builder'.
Please advice,
Liora
Donald Nong
commented Nov 02 '14, 7:19 p.m.
If you are using Firefox, bear in mind that there can be only one user actively connected to CLM. You need to log out a user before logging in as another user.
Liora Milbaum
commented Nov 02 '14, 11:43 p.m.
Donald, I am using RQMUrlUtility. The user credentials are provided as arguments. Liora, the 412 (Precondition Failed) response code indicates something is missing in the PUT request. Can you try using the HttpRequester/Poster Firefox plug-in and post the response content?
Paul, tried using the HttpRequester/Poster Firefox plug-in. I am trying to figure out how to work with it. |
Paul, I didn't figure out how to use Ff as you suggested.
What I have done was to change the logger settings to DEBUG and than run the RQMUrlUtility with the PUT command again. This is what I have found in the qm.log file:
58627 2014-11-04 14:00:57,682 [http-bio-9443-exec-233 @@ 14:00 LMB /qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+(Q uality+Management)/executionresult/urn:com.ibm.rqm:executionresult:47] DEBUG repository.service.internal.rdb.TransactionalCache - Returning VALID re port for entry status. The cache entry was: CacheEntry[key='com.ibm.rqm.deployment.model.impl.BucketLockHandleImpl@70e570e5 (stateId: [UUID _4YcX8GQX EeSeoaOdcVHt2Q], itemId: [UUID _4YRY0GQXEeSeoaOdcVHt2Q], origin: null, immutable: <unset>)';uuid=_Nzlq62QYEeSeoaOdcVHt2Q;futureValue=FVReference[key= com.ibm.rqm.deployment.model.impl.BucketLockHandleImpl@70e570e5 (stateId: [UUID _4YcX8GQXEeSeoaOdcVHt2Q], itemId: [UUID _4YRY0GQXEeSeoaOdcVHt2Q], ori gin: null, immutable: <unset>);mayHaveAFuture=true;isEnqueued=false;ref=com.ibm.rqm.deployment.model.impl.BucketLockImpl@6ff66ff6 (stateId: [UUID _4Y cX8GQXEeSeoaOdcVHt2Q], itemId: [UUID _4YRY0GQXEeSeoaOdcVHt2Q], origin: <unset>, immutable: true) (contextId: [UUID _8lNyYNwSEd2pIJ5QVwgQGg], modified : 2014-11-04 13:44:07.896, workingCopy: false) (predecessor: <unset>) (artifact: executionresult, bucket: 8)];extraInfo=412;head->null]
Comments Liora, this DEBUG log message does not indicate the cause of the 412 (Precondition Failed) response code. You need to capture the response content to resolve the reason. Please follow the instructions in https://jazz.net/wiki/bin/view/Main/RQMUsingPoster to use Poster.
Liora Milbaum
commented Nov 04 '14, 11:32 a.m.
I have followed the instructions and succeed working with Poster.
This is the error I get during the PUT:
Error 403: The user has the roles required to perform this operation, but the permission has been denied because this request might have been forged by a malicous website. To prove that this request is not part of a CSRF attack add a new HTTP header with the name &#x27;X-Jazz-CSRF-Prevent&#x27; and use the current JSESSIONID value as the value.
Liora Milbaum
commented Nov 04 '14, 11:41 a.m.
I have added the header and it worked. It doesn't work with the RQMUrlUtility. 1
Please open a RQM defect and we will fix the RQM URL Utility.
Liora Milbaum
commented Nov 05 '14, 2:17 a.m.
|
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.
Comments
Can you please be more specific how you use the PUT method? I can use PUT against the resource URI to update attributes of a test artifacts without any errors. For example, below is the response body, along with HTTP 200 code, that I get when updating the title of a test case result.
P.S. Testing done with RQM 5.0.1.Well, I am receiving the XML representation of the Test Result with the GET command, updating the XML file (changing the state from one state to another) and than issuing a PUT command with this XML.
The <rqm:resultExternalId> is only in the response body, not in the request that I sent. The payload only contains <rqm:title> in my test. Also I was using a REST client to do the test, not RQMUrlUtility.
Umh...when I think about it, is it because you upgraded from 4.0.4 to 5.0.1 and I have a brand new 5.0.1 environment?