It's all about the answers!

Ask a question

REST API: How to get the value of a List custom attribute?


Joseph Reedick (10847) | asked May 18 '12, 2:20 p.m.
Given a custom attribute that is a list, how to I get the selected value via the REST API?

When I use the direct url for the requirement, string based custom attributes show up with the value:
<rm_property:_DMhjGCz-EeG6U9u3DDmcLw rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.01</rm_property:_DMhjGCz-EeG6U9u3DDmcLw>

"0.01" is the value of this text attribute.

However, all of the List attributes show up as blank:
<rm_property:_6AmpPS0BEeG6U9u3DDmcLw rdf:resource="https://my_server:9443/rm/types/_0KlRCy0BEeG6U9u3DDmcLw#7631d913-cef1-494d-86ea-b85f424bbad8"/>


I can find the shape, the "allowedValues" for the list, etc., but I simply cannot find the selected item for the list attribute for a given requirement.

Any ideas?

3 answers



permanent link
Joseph Reedick (10847) | answered May 24 '12, 5:54 p.m.
Looks like the trick is to use the Reporting API: https://jazz.net/forums/viewtopic.php?p=81791#81791

Ex: if your requirement's id is "_W-vmnoJAEeGu_srBRZVCTg" i.e. the REST url is
https://rrc.it.att.com:9443/rm/resources/_W-vmnoJAEeGu_srBRZVCTg

then use

https://server:port/rm/publish/resources?resourceURI=_W-vmnoJAEeGu_srBRZVCTg

as per the "Filter id(s)" on https://jazz.net/wiki/bin/view/Main/RRCReportableRestAPI

You will see the values for list attributes, the traceability links, etc.. The actual value is visible in attribute:literalName.

permanent link
Jiong Xie (7154) | answered May 23 '12, 3:27 a.m.
JAZZ DEVELOPER
Count me in!
I have the same question.

Maybe can a developer give some advice and samples?

permanent link
Jiong Xie (7154) | answered May 24 '12, 6:14 p.m.
JAZZ DEVELOPER
Thanks!
I forgot the Reporting API, which I should not have. :-))
Yes, through the publish call I also found the list value.

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.