Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

how to query custom attribute for a value using RRC rest api

 Below query just returns all Requirements which have the custom attribute, but what I'm looking for is to filter further based on a certain value of the custom attribute. Any help is appreciated:

0 votes


Accepted answer

Permanent link

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>

Binoy D'costa selected this answer as the correct answer

0 votes

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

Gabriel, 

This works using curl on linux platform. I was trying to use REST client in chrome and I get different results. Should have tried this before. Thanks a bunch!

-Binoy
 


One other answer

Permanent link
Hi,
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.

0 votes

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.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jul 18 '13, 6:39 p.m.

Question was seen: 7,133 times

Last updated: Aug 05 '13, 6:46 p.m.

Confirmation Cancel Confirm