I usually do quick prototypes of my work in shell, so I'm trying to get list of last 20 changesets in a repo
FEAUTH=`curl -s "${FECRU_HOST}/rest-service/auth-v1/login?userName=${FECRU_USER} password=${FECRU_PASSWORD}" | sed -e 's#^.*<token>##' -e 's#</token>.*$##'` curl -v "${FECRU_HOST}/rest-service-fe/changeset-v1/listChangesets?FEAUTH=${FEAUTH}&rep=RT.control&expand=changesets&limit=20"
Without "limit=20" everything works as expected - I get about 6k changesets. After I've added "limit=20", I still get 6k responses; even more interesting, it's in XML, not in JSON - though my reading of https://docs.atlassian.com/fisheye-crucible/latest/wadl/fisheye.html is that as soon I specify "limit" parameter, I should be getting paged JSON. I've tried "application/json" as a header - didn't help.
What am I doing wrong?
Community moderators have prevented the ability to post new answers.
works perfectly! thanks a lot!
CSID=`curl -s -H"Accept: application/json" "${FECRU_HOST}/rest-service-fe/revisionData-v1/changesetList/RT.control?FEAUTH=${FEAUTH}&maxReturn=20" | sed -e 's/^.*\[//' -e 's/\].*$//' -e 's/"//g' -e 's/,/ /g'` for c in $CSID do curl -s -H"Accept: application/json" "${FECRU_HOST}/rest-service-fe/revisionData-v1/changeset/RT.control/${c}?FEAUTH=${FEAUTH}" printf "\n---------------------\n" done
Hi Mark,
I'm afraid there is no limit parameter implemented for the endpoint you are using, see documentation page https://docs.atlassian.com/fisheye-crucible/3.6.0/wadl/fisheye.html#rest-service-fe:changeset-v1:listChangesets.
You can use other endpoints though. Take a look at https://docs.atlassian.com/fisheye-crucible/3.6.0/wadl/fisheye.html#rest-service-fe:revisionData-v1:changesetList:repository - that brings a list of changesets and response size can be limited with a maxReturn parameter. It returns changeset ids only, but you can then make a separate call to https://docs.atlassian.com/fisheye-crucible/3.6.0/wadl/fisheye.html#rest-service-fe:revisionData-v1:changeset:repository:csid to retrieve full details of the particular changeset.
For instance:
Regarding response format, XML is returned by default, but you can easily request JSON response by either:
Hope that helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, no JSON then - can I somehow limit amount of output? 20 rows? 60 last days? Anything?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A paged REST API call is usually marked as one like on the following page.
https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html
Your API call is not marked as a paged API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.