Summary

      Entering the limit parameter in the REST API does not change the limit of results returned.

      limit int The maximum number of items to return per page. Default: 50. See the Pagination section at the top of this document for more details.

      Environment

      JIRA Service Desk REST API

      Steps to Reproduce

      1. Create a GET request for Customer Requests
        <baseURL>/rest/servicedeskapi/request
        
      2. Observe the "limit" from the result
      3. Change the limit to a higher value and re-send the GET request
      4. <baseURL>/rest/servicedeskapi/request?limit=999
        
      5. Observe the "limit" from the result

      Expected Results

      Changed limit does not affect the results returned. It may be higher than the default value 50

      Actual Results

      Changed limit affects the results returned

      Notes

      JIRA Service Desk REST API is still an experimental release as per this comment

      Workaround

      No workaround as of now

            [JSDSERVER-4186] REST API 'limit' parameter has no effect

            Dawid Krysiak added a comment - - edited

            cbed8916b89e 
            I went around this programmatically.

            Here is an example in Python, easy to get the idea. 
            get the page of 100 items and keep paginating until the page comes empty

             

            1. define a client

               jira = JIRA(
                    basic_auth=(username,password),
                    options= {
                        'server' : server,
                        'fields' : "comment",
                        'expand' : 'changelog'
                   )

            # define a query    

            jql = 'category = Support and updated > startofday(-1d)'
                
                block_size = 100
                block_num = 0
                i = 0
                tickets_list = []
                while True:
                    start_idx = block_num * block_size
                    if block_num == 0:
                        issues = jira.search_issues(jql, start_idx, block_size)
                    else:
                        more_issues = jira.search_issues(jql, start_idx, block_size)
                        if len(more_issues)>0:
                            for x in more_issues:
                                issues.append
                        else:
                            break
                    if len(issues) == 0:
                        # Retrieve issues until there are no more to come
                        break
                    block_num += 1

             

             

            Dawid Krysiak added a comment - - edited cbed8916b89e   I went around this programmatically. Here is an example in Python, easy to get the idea.  get the page of 100 items and keep paginating until the page comes empty   define a client    jira = JIRA(         basic_auth=(username,password),         options= {             'server' : server,             'fields' : "comment",             'expand' : 'changelog'        ) # define a query     jql = 'category = Support and updated > startofday(-1d)'          block_size = 100     block_num = 0     i = 0     tickets_list = []     while True:         start_idx = block_num * block_size         if block_num == 0:             issues = jira.search_issues(jql, start_idx, block_size)         else:             more_issues = jira.search_issues(jql, start_idx, block_size)             if len(more_issues)>0:                 for x in more_issues:                     issues.append             else:                 break         if len(issues) == 0:             # Retrieve issues until there are no more to come             break         block_num += 1    

            This issue needs to be duplicated for JSD Cloud. The limit is not working there either. I used the following REST API Call:

            base_url/rest/servicedeskapi/servicedesk/serviceDeskIdentifier/customer?limit=1000

            Schal, Thomas added a comment - This issue needs to be duplicated for JSD Cloud. The limit is not working there either. I used the following REST API Call: base_url /rest/servicedeskapi/servicedesk/ serviceDeskIdentifier /customer?limit=1000

            I've been bit by this as well. It doesn't affect my day-to-day but I needed to work around it in a script I wrote that processed tickets. Would be nice if it worked in the future.

            Greg Geller added a comment - I've been bit by this as well. It doesn't affect my day-to-day but I needed to work around it in a script I wrote that processed tickets. Would be nice if it worked in the future.

            I managed to increase that limit by passing maxResults=100 
            (for issue in jira.search_issues('category = support AND createdDate > startOfWeek()', maxResults=500)
             So I am barely managing to do per-day statistics, but it doesn't change the fact that we need more! One would think that a system should be able to handle more than 100 results?

             

            Dawid Krysiak added a comment - I managed to increase that limit by passing maxResults=100  (for issue in jira.search_issues('category = support AND createdDate > startOfWeek()', maxResults=500)  So I am barely managing to do per-day statistics, but it doesn't change the fact that we need more! One would think that a system should be able to handle more than 100 results?  

            Limit is fixed to 50 and cannot be changed. This is annoying as usually results are way more than 50. Please allow to increase the limit.

            Dimitris Ballas added a comment - Limit is fixed to 50 and cannot be changed. This is annoying as usually results are way more than 50. Please allow to increase the limit.

            limit works, but only for 1 thru 50.  when will it work for more ??

             

            /rest/servicedeskapi/organization?start=0&limit=100

            Mike DiGiantomasso added a comment - limit works, but only for 1 thru 50.  when will it work for more ??   /rest/servicedeskapi/organization?start=0&limit=100

              Unassigned Unassigned
              cchan Chung Park Chan
              Affected customers:
              11 This affects my team
              Watchers:
              12 Start watching this issue

                Created:
                Updated: