how to query custom attribute for a value using RRC rest api
Accepted answer
Those values can be extracted from the Instance shape,, use OSLC Name field as :
<oslc:Property>
<oslc:valueType rdf:resource="http://www.w3.org/2001/XMLSchema#int"/>
<oslc:propertyDefinition rdf:resource="https://gradev.ibm.com:9444/rdm/types/_Jp-fMfkZEeKEG5px7R2FmA"/>
<oslc:range rdf:resource="https://gradev.ibm.com:9444/rdm/types/_JBgJ9PkZEeKEG5px7R2FmA"/>
<oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>
<dc:description rdf:parseType="Literal"></dc:description>
<dc:title rdf:parseType="Literal">Planned Release</dc:title>
<oslc:name>_Jp-fMfkZEeKEG5px7R2FmA</oslc:name>
</oslc:Property>
Comments
I'm not following. I have a custom attribute called "Requirement ID" which is an attribute of type "string". I already know its "oslc:name" which is "_ry2_8ahPEeKkfY4h6KgkBA". The value of this attribute is typed in manually by the user and is a text.
What i want to do is to query artifacts using the RRC Rest api by the value of this attribute. Something like: show me all artifacts where the attribute _ry2_8ahPEeKkfY4h6KgkBA = "UMS"
Is this possible?
Thanks,
Binoy
Yes, that should work, I just successfully tried :
&oslc.prefix=rm_property=<https://gradev.ibm.com:9444/rdm/types/>
&oslc.select=*
&oslc.where=rm_property:_MkiPBPuOEeKrautu-HXo_w="MYTEXT"
1 vote
One other answer
Have you seen the query samples in https://jazz.net/library/article/1197. it looks like you will have to specify the complete attribute URL.
Comments
Yes, i don't see a way to filter a particular attribute by its value. The examples talk about filtering requirements by attribute but not by their values. Is there a way?
Thanks,
Binoy
is following query similar to what you are looking for ?
"To query for all artifacts that have the Status property set to Approved, use a query similar to. Note: To run this type of query, you must obtain the value of the Approved state from the instance shape. After you have the value, create a query that is like this one:"
"
&oslc.prefix=rm_property=<https://grarrc.ibm.com:9443/rm/types/>&oslc.select=*&oslc.where=rm_property:_PfIW0OrtEeGaNr-hWVrMiw=<https://grarrc.ibm.com:9443/rm/types/_PamcJOrtEeGaNr-hWVrMiw%233e9db9f1-3d5c-4716-aae0-f48d49260a8b>"
yes similar but for custom attributes which is of type string not enumeration. How do I get the value of it from the instance shape? I don't think this is possible.