It's all about the answers!

Ask a question

How to get custom enumeration value of RTC with REST using java http client .

silencehill wu (5022632) | asked Dec 29 '13, 11:28 a.m.
I am writing program  to get custom  enumeration values by http client using OSLC-CM 2.0 (REST) in java language.  RTC-SDK is not allowed to be used.

For example:

    I have custom define a new type bugtype.

      <enumeration attributeTypeId="bugtype" name="bugproblemtype"> 
           <literal id="bugtype.literal.l1" name="CA-用例缺陷"/> 
           <literal id="bugtype.literal.l2" name="DOC-文档错误"/> 
           <literal id="bugtype.literal.l3" name="EC-编码错误"/>


1. I want to get a map <id, name=""> of enumeration.

  AttributeTypeId ="bugtype"  or  name ="bugproblemtype" as argument. I want to get the map as below:

  <bugtype.literal.l1, CA-用例缺陷="">, <bugtype.literal.l2, DOC-文档错误="">, <bugtype.literal.l3, EC-编码错误="">

2. I want to get a id by name

Input CA-用例缺陷 as argument, the id  bugtype.literal.l1 will be return.

Please give me some advise.

silencehill wu commented Jan 01 '14, 9:49 a.m. | edited Jan 01 '14, 11:41 a.m.

 no advise???

Geoffrey Clemm commented Jan 01 '14, 11:42 a.m.

Most of the regular contributors to the forum are on vacation for Christmas and New Years, so it probably will be a few days before you get a response.

2 answers

permanent link
Eric Jodet (6.3k5111120) | answered Jan 02 '14, 3:57 a.m.

Hope it helps,

sam detweiler commented Jan 02 '14, 8:46 a.m.

he was looking for REST methods, not java code.

permanent link
Rafik Jaouani (5.0k16) | answered Jan 03 '14, 12:10 p.m.

The Reportable REST API can give you such data. Please refer to this WIKI for info and examples about the API:

Here is an example:


The get an XSD schema describing the data exposed by the API:


But of course if the Work Items OSLC API can also give you the data, that would be the better choice.

The Reportable REST API is supposed to be used by ETLs and Reports and not a WEB UI as it is heavy on caching and could be slow.

silencehill wu commented Jan 06 '14, 11:47 a.m.

I found Reportable REST API should be RTC3.0.11.But my RTC only RTC3.0, it is not appliable.

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.