How to query RTC using OLSC and get a list of categories and rtc id's
![](http://jazz.net/_images/myphoto/a4952b840a8a44763d082c31c1274059.jpg)
Hi All,
I need to get a list of categories and rtc id's out of RTC, and I'd like to be able to do this through rest so that I can actually deal with live data, versus having to go through the DW since my user base likes to change those categories without letting me know (that is a side bar). So far I've had success in getting the catagories running this query
https://server/ccm/oslc/categories?oslc_cm.pageSize=50&_resultToken=_1TH_kR54EeSPbpkYQHMcrg&_startIndex=0
but what is returned is something like this
<rtc_cm:Category rdf:resource="https://server/ccm/resource/itemOid/com.ibm.team.workitem.Category/_gcAowh5iEeSPbpkYQHMcrg">
<rtc_cm:projectArea rdf:resource="https://server/ccm/oslc/projectareas/_jqcUgMeiEeKRJOHANpY1-A"/>
<dc:title>Jim and Alex's Excellent Adventure</dc:title>
<rtc_cm:hierarchicalName>In Concert/Jim and Alex's Excellent Adventure</rtc_cm:hierarchicalName>
<dc:description/>
<rtc_cm:defaultTeamArea rdf:resource="https://server/ccm/oslc/teamareas/_Y3crJh5iEeSPbpkYQHMcrg"/>
<rtc_cm:teamAreas/>
<rtc_cm:depth>1</rtc_cm:depth
Which is great, but in order for me to do some of the things i need to do with this data, I need to get the RTC id's of each category, so the stringliteralxxxxxxx but i'm getting the encoded URL. Is there a way to achieve this through REST?
One answer
![](http://jazz.net/_images/myphoto/a4952b840a8a44763d082c31c1274059.jpg)
Enumerations are what you should look at, not categories. The easiest way to do that is like this.
Pick a work item that contains this "Priority" attribute and copy its shortcut.
P.S. Another way to get it is in the Process Configuration Source, but that's not using REST API.
Pick a work item that contains this "Priority" attribute and copy its shortcut.
https://clm406:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/7Do a GET in your REST client, and locate the attribute value.
https://clm406:9443/ccm/oslc/enumerations/_YAOpUK2SEeOZZsxCNqN2HA/priority/priority.literal.l11Remove the last bit of the URI and do another GET.
https://clm406:9443/ccm/oslc/enumerations/_YAOpUK2SEeOZZsxCNqN2HA/priorityThere you have it.
P.S. Another way to get it is in the Process Configuration Source, but that's not using REST API.
Comments
Donald Nong
Aug 10 '14, 11:28 p.m.What "rtc id" do you want to retrieve with regard to categories? "_gcAowh5iEeSPbpkYQHMcrg" is the Id in your above sample. For a work item category, name/title, path and description are all you have and they are all in the above sample. Are you talking about a different "category" such as enumerations?
Alex Olson
Aug 11 '14, 1:37 p.m.Right that is the key, what i'm looking for though is not that rtc url but this
value ="priority.literal.l11" key="High"
so i'm looking in the rest interface for any query i can do that would basically equate gcAowh5iEeSPbpkYQHMcrg to priority.literal.l11