Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira ServiceDesk Get customers request limit

Artem Lemeshko February 11, 2020

I'm using GET /rest/servicedeskapi/servicedesk/{serviceDeskId}/customer with query params "start" and "limit". By default, the limit is 50. Thereby when I'm trying put a limit on 300 it still returns 50. 

Question: Is there some bounds putting a high limit value on this request?

1 answer

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2020

Hey Artem,

First, I do need to note that the /customer endpoint is experimental - so oddities can (and do, as explained momentarily) occur with the parameters. These are technically not supported in the product yet. Our official line for experimental endpoints: "Features and methods marked as experimental may change without notice."

After tinkering with the endpoint for a while, I noticed that the start value returned by the results is currently always 0, even if you define (and are being returned) later start values. This is definitely a bug.

image.png

For the limit parameter, we've got this line in the documentation:

The maximum number of users to return per page. Default: 50.

This (50) does appear to be the upper limit. You can set a lower limit (such as 5) and it will return that many results. But no more than 50. I see how this is confusing from the documentation - I had to play around with the size and limit parameters for a bit to determine which had an effect. Here are some pointers on how they currently operate:

  • In the response, "limit" is always 50. That indicates that the page size is a maximum of 50 objects.
  • In the response, "size" is how many objects are on the particular page of results.
  • When making a request - the limit parameter is used to indicate how many results come back per page. If no value is specified, it will default to 50. The maximum for this value in a request is also 50.
  • When making a request, the "size" parameter in your request currently has no effect, despite the documentation indicating it should specify how many objects to return per-page.

I've opened the two following bugs about this endpoint given the discrepancies:

 

Given all the above, my recommendation is to increment the start parameter in values of 50 when you're iterating through responses. You'll know that you're on the last page of results when the size in the response drops below 50 or becomes zero (if you proceed to the next page beyond the actual "last page". The last page would have a size 50 if you had a number of customers divisible by 50, example: 200 customers, start 150)

I hope this helps clarify things to get you the correct results you need for this experimental API endpoint.

Cheers,
Daniel

Artem Lemeshko February 28, 2020

Hi @Daniel Eads 
Thank you for committing to my question!
That exactly what I eventually decided to do.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events