Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

retrieving rational team concert work items via REST api

 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

0 votes


Accepted answer

Permanent link
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

0 votes

Comments

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

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Mar 31 '15, 2:46 p.m.

Question was seen: 4,751 times

Last updated: Apr 01 '15, 9:14 a.m.

Confirmation Cancel Confirm