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-编码错误"/>

    </enumeration>

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.


Comments
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.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.
JAZZ DEVELOPER
 Hello,

Hope it helps,
Eric

Comments
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.
JAZZ DEVELOPER

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

https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI

Here is an example:

https://server:port/ccm/rpt/repository/workitem?fields=workitem/projectArea[name='Test']/enumerations/(id|literals/*)

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

https://server:port/ccm/rpt/repository/workitem?metadata=schema

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.


Comments
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.