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

RTC 6.0.2 - Query work items curl command

Hi,

This is my Project Area simple query link
https://gid.caixa:9443/ccm/oslc/contexts/_KiyJFyYUEeOUpOocmzUjUQ/workitems

Generate the cookie

set USER=philippe
set PWD=philippe
set COOKIES=cookies.txt
 

curl.exe -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PWD% https:/
/gid.caixa:9443/ccm/authenticated/j_security_check

Try run this command to get the work items
curl.exe -k -b %COOKIES% https://gid.caixa:9443/ccm/oslc/contexts/_KiyJFyYUEeOUpOocmzUjUQ/workitems

But the command don't returns the items. Nothing is displayed on output.

Questions:
1) Is the command right? Why don't returns the items?
2) What curl command to get items by type in a Project Area?

Thanks

0 votes



One answer

Permanent link

Adding the -v parameter will give you more detailed information about what you actually get.

When I followed the exact commands, I got the same result and the response of the third command was "HTTP/1.1 406 Not Acceptable". This is because cURL by default sends out HTTP request header "Accept: /". So to get the desired result, you need to send an HTTP requested header "Accept: application/xml". The third command should look like:
curl.exe -v -k -H "Accept: application/xml" -b %COOKIES% https://gid.caixa:9443/ccm/oslc/contexts/_KiyJFyYUEeOUpOocmzUjUQ/workitems

That should answer your first question.

For the second one, it's not about cURL, but rather the OSLC URL that you put in the command. See the below document for details.
https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20#Query_Capabilities

0 votes

Comments

Hi Donald,
Thanks by answers.
For th first question, I run the command proposed by you, but with bit differences.
The right HTTP reader in this case is ""Accept: application/x-oslc-cm-change-request+xml".
I was forced to include the "oslc_cm.pageSize" argument because the pagination. The maximum value is "100".

Then, the runned command was:

curl.exe -v -k -H "Accept: application/x-oslc-cm-change-request+xml" -b %COOKIES% https://gid.caixa:9443/ccm/oslc/contexts/_KiyJFyYUEeOUpOocmzUjUQ/workitems?oslc_cm.pageSize=100

Is There a way to disable or bypass the pagination?
Stay I limited to 100 workitems on a query result?

For the second question (get items by type), I didn't read the link posted yet.
Return as soon as I read.

Thanks Donald

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
× 17

Question asked: Aug 16 '17, 7:52 p.m.

Question was seen: 3,316 times

Last updated: Aug 18 '17, 7:18 p.m.

Confirmation Cancel Confirm