It's all about the answers!

Ask a question

Accessing custom attributes definition from rest api in rqm test cases


Arnaud Bouzy (2324) | asked May 12 '14, 9:12 a.m.
 Using rqm api 4.0, I would like to add a value to a custom attribute, knowing only its name.
I can post the the new value of the test case, but for the custom attribute, I need to know not only its name and value, but also its identifier and type (which are also not obvious to get from RQM GUI...)
I didn't find a way to retrieve through the api, from a given project, the list of defined custom attributes and their details.
Can I have access to this custom definition ?

Thanks for help.

Accepted answer


permanent link
Paul Slauenwhite (8.4k12) | answered May 13 '14, 7:49 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Unfortunately, the RQM Reportable REST API does not support a custom attribute resource type (see https://jazz.net/wiki/bin/view/Main/RqmApi#Resources_and_their_Supported_Op).  Since the custom attribute identifier/name/value properties are required (see https://jazz.net/products/rational-quality-manager/api-doc-4.0.6/schemas/qm_xsd/elements/customAttributes.html#a4), I would suggest creating a custom attribute and test case in the RQM UI and GET the testcase resource to see the required custom attribute identifier/name/value properties.  For example:

<ns2:testcase>
...
        <ns2:customAttributes>
          <ns2:customAttribute required="true" type="SMALL_STRING">
            <ns2:identifier>Sample_custom_attribute</ns2:identifier>
            <ns2:name>Sample custom attribute</ns2:name>
            <ns2:value>Sample custom attribute value</ns2:value>
            <ns2:description/>
          </ns2:customAttribute>
        </ns2:customAttributes>
...     
</ns2:testcase>
Arnaud Bouzy selected this answer as the correct answer

Comments
Arnaud Bouzy commented May 13 '14, 9:11 a.m.

  Yes. This was actually my fear.

Any update coming on this with RQM v5 ?
Thanks anyway for your quick answer


Paul Slauenwhite commented May 13 '14, 9:38 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

I could not find a related enhancement.  Please open a RQM enhancement.


Arnaud Bouzy commented Jun 03 '14, 5:10 a.m.

 Hi Paul,


Coming back to this, I just realized that there seems to be no simple way to get the attribute identifier from the attribute name (if the name changes, the identifier is kept identical, which seems a good idea :-)).
But there also seems to be no way to see, on a user point of view, from the GUI, what is this identifier. So as there is no way to get that from the API, there is no way to get it from the application... How can I find it ? I'm stuck here...


Paul Slauenwhite commented Jun 03 '14, 6:43 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Hi Arnaud,

The identifier and name properties are different.  The name property can be changed using the RQM Reportable REST API and/or RQM UI.  However, the identifier property is immutable and not exposed in the RQM UI.  You can use the web ID (exposed in the RQM UI) in an internal ID (if supported by the resource type) in the RQM Reportable REST API.  For more information on the types of IDs (including internal IDs) supported by the RQM Reportable REST API, see https://jazz.net/wiki/bin/view/Main/RqmApi#id.

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.