IBM Rational (RQM): Loop over custom field
IBM Rational (RQM): Loop over custom field
Article summary
Did you find this summary helpful?
Thank you for your feedback
In the IBM Rational connector, when specifying raw XML you can embed multi-select custom fields, and loop over them to repeat XML.
In the example xml below we have a multi select field called 'multi' which is overlaid on the model.
<testcase xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns4="http://purl.org/dc/elements/1.1/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1">
<ns4:title>{{TestPathAttributes.TestName}}</ns4:title>
<ns4:description>{{TestPathAttributes.TestSummaryListHTML}}</ns4:description>
$ foreach Item in {{TestModelVersionAttributes.Custom}}[multi] $
<ns2:category term="Family" value="{{Item}}" />
$ endforeach $
</testcase>
When the XML is resolved the category tag is repeated per the value of the multi-select field.