It's all about the answers!

Ask a question

retrieving rational team concert work items via REST api


David Todd (812) | asked Mar 31 '15, 2:46 p.m.
 Hi,

I'm trying to retrieve rational team concert work items via REST api and curl.

I can login successfully with these two statements:
curl -k -c $COOKIES https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/authenticated/identity
curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PWD https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/authenticated/j_security_check

# I get a simple query url with this statement:
curl -k -b $COOKIES https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/oslc/contexts/_OtsvcBWvEeOYac7sZ6RSdw/workitems/services.xml

However, when I issue the following simple query to get the work items: 
curl -k -b $COOKIES https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/oslc/contexts/_OtsvcBWvEeOYac7sZ6RSdw/workitems

I get no work items. This is returned:
{
   "userId": "iscipdev@us.ibm.com",
   "roles": [
       "JazzGuests"]
}

Can someone tell me what I'm doing wrong? Thanks

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Mar 31 '15, 8:26 p.m.
Not sure why you got such response for the last URL, as it should output nothing in the console. To understand what's going on, use "-v" to show more information. The last URL normally returns a HTTP 302 with a location link, and you should use "-L" to tell cURL to redirect to that link. This post should help you.
https://jazz.net/forum/questions/168979/rest-api-curl-to-query-and-create-workitem-rtc
David Todd selected this answer as the correct answer

Comments
David Todd commented Apr 01 '15, 9:14 a.m.

 Thank you Donald! The information you provided helped me to get further.

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.