It's all about the answers!

Ask a question

How to query RTC using OLSC and get a list of categories and rtc id's

Alex Olson (611) | asked Aug 08 '14, 12:14 p.m.
 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 


but what is returned is something like this

<rtc_cm:Category rdf:resource="https://server/ccm/resource/itemOid/">
<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>
<rtc_cm:defaultTeamArea rdf:resource="https://server/ccm/oslc/teamareas/_Y3crJh5iEeSPbpkYQHMcrg"/>

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?

Donald Nong commented 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 commented 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

One answer

permanent link
Donald Nong (14.5k614) | answered Aug 12 '14, 2:22 a.m.
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.
Do a GET in your REST client, and locate the attribute value.
Remove the last bit of the URI and do another GET.
There you have it.
P.S. Another way to get it is in the Process Configuration Source, but that's not using REST API.

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

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.