It's all about the answers!

Ask a question

How to create new labResourceAttribute via RQM API


evgeniia melamud (133) | asked Jul 19 '21, 3:16 a.m.
edited Aug 02 '21, 4:18 a.m.

 Hi


We're using RQM both via UI and RESTApi and we would like to automate the process of adding new lab resources attributes to RQM. (Unfortunately I can't post a screenshot, but those attributes can be seen at 
Manage Project Properties -> Properties -> Lab Resources and Channel Properties)

I've checked the Api specification here: https://jazz.net/wiki/bin/view/Main/RqmApi#The_Lab_Resource_Catalog, and I can see that it's possible to PUT new lab resource, but it's not possible to POST new lab resource attribute.

I'm trying to use PUT method for creating LabResourceAttribute, but doesn't matter what I'm trying to do I get 400 Bad request responce.

Here is the example of xml I'm trying to use as a body for PUT method

<ns2:labresourceattribute xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns1="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://purl.org/dc/elements/1.1/" xmlns:ns4="http://jazz.net/xmlns/prod/jazz/process/0.6/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://purl.org/dc/terms/" xmlns:ns7="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns10="http://open-services.net/ns/core#" xmlns:ns11="http://open-services.net/ns/qm#" xmlns:ns12="http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/" xmlns:ns13="http://www.w3.org/2002/07/owl#" xmlns:ns14="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns15="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns16="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns17="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns18="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns20="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/" xmlns:ns21="http://www.w3.org/1999/XSL/Transform">
  <ns2:externalIdentifier>IdentifierUnique</ns2:externalIdentifier>
  <ns3:title>SomeTitle</ns3:title>
</ns2:labresourceattribute>

In RQM log there is something about ID:
Cannot create or update a resource of type labresourceattribute with a missing ID

but in the documentation it stays that it's enough to define external ID which IS defined.

Thanks in advance 

Accepted answer


permanent link
abhishek gour (3812) | answered Jul 20 '21, 2:38 p.m.
edited Jul 20 '21, 2:46 p.m.

Hi,

As you have mentioned the complete list of attributes can be obtained via - https://jazz.net/wiki/bin/view/Main/RqmApi#The_Lab_Resource_Catalog

While creating Lab Resource attribute - you could create a new attribute under a given parent using PUT request. See labresourceattribute under - https://jazz.net/wiki/bin/view/Main/RqmApi.

The load body you have provided looks good. But the URI is not mentioned.
The sample URI could be -
https://<hostname>/<contextroot>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<projectArea>/labresourceattribute/<userDefinedExternalID>
The created attribute would be assigned with this external ID.

evgeniia melamud selected this answer as the correct answer

Comments
evgeniia melamud commented Jul 21 '21, 3:30 a.m.

 Thank you very much, it works now with the trick that externalId has to be written as a part of URL

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.