How to query RTC using OLSC and get a list of categories and rtc id's
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
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. 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
Alex Olson
commented Aug 21 '14, 11:46 a.m.
I'm getting a name is not a valid propery for workitem error?
Donald Nong
commented Aug 21 '14, 8:37 p.m.
Can you please clarify the work flow that you got this error? There is no filtering or field selection in the three links that I posted and I can't imagine how the error comes out.
|
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.
Comments
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?
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