Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes

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.

<entry xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult" xmlns="http://www.w3.org/2005/Atom" >
    <rqm:resultId xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult" >71</rqm:resultId >
    <rqm:resultItemId xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult" >_445_sERlEeSsYsRLqtyMDg</rqm:resultItemId >
    <rqm:resultExternalId xmlns:rqm="http://schema.ibm.com/rqm/2007#executionresult" >urn:com.ibm.rqm:executionresult:71</rqm:resultExternalId >
</entry >
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.


As I mentioned, all is done using RQMUrlUtility.

I have looked at your sample and it has the rqm:resultExternalId tag. The XML I have doesn't have this tag.

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?



2 answers

Permanent link
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.

1 vote

Comments

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

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.

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. 


Permanent link
 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]
 

0 votes

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.

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 &amp;#x27&#59;X-Jazz-CSRF-Prevent&amp;#x27&#59; and use the current JSESSIONID value as the value.

 I have added the header and it worked. It doesn't work with the RQMUrlUtility.

Please open a RQM defect and we will fix the RQM URL Utility.

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,940

Question asked: Oct 28 '14, 12:27 p.m.

Question was seen: 5,860 times

Last updated: Nov 05 '14, 2:17 a.m.

Related questions
Confirmation Cancel Confirm