Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-82342

Fetching results from worklog/updated API Endpoint can result in execution timeout

XMLWordPrintable

      Issue Summary

      When using the API endpoint /rest/api/3/worklog/updated, although it has a constraint of 1000 items on its results, it can throw a timeout error.

      This happens due to the way the endpoint is designed; The steps the endpoint fetches the records are as follows:

      • Fetch 1000 records;
      • Check the resultset and confirm if the User that's running the endpoint has access to all of these items returned;
      • If the User doesn't have access to any of the records in the result set, those are discarded, and the fetch step is run again;
      • For the new result set, the check for permission is run again;
      • This is run until there are 1000 records in the result set, and the User running the endpoint has access to all records.

      This will eventually lead to timeouts if the fetch and check steps are constantly run.

      Steps to Reproduce

      • Have a worklog that would fetch more than 1000 and the User running the endpoint could fall under the permissions constraint, as explained in the scenario above.

      Expected Results

      • The 1000 items being returned in the result set;

      Actual Results

      • The endpoint throws a 500 HTTP Error due to timeout.

      Workaround

      As a workaround, one could add the since parameter filter, to narrow down the search; However, it might still throw the timeout error depending on how the User Permission would cause the fetch/permission check loop count.

              Unassigned Unassigned
              2cbc34056992 Michel Guedes
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: