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

rest/api/2/search endpoint returns error 500 when expanding the changelog

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Highest
    • Ecosystem
    • None

    Description

      Summary

      Running a search calling the REST API endpoint rest/api/2/search (methods GET and POST) returns "Internal Server Error" (error 500) when expanding the changelog.

      Steps to Reproduce

      1. Run a search using the REST API and expand the changelog. For example:
        curl -D- -u EMAIL:PASSWORD -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"jql":"key=ISSUE-KEY", "expand": ["changelog"] }' https://INSTANCE/rest/api/2/search
        

      Expected Results

      The issue having "key=ISSUE-KEY" is returned.

      Actual Results

      "HTTP/1.1 500 Internal Server Error" is returned and the below exception is logged by JIRA:

      com.atlassian.jira.rest.exception.ExceptionInterceptor	Returning internal server error in response	 	java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor1407.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$TypeOutInvoker$1.invoke(DispatchProviderHelper.java:222)
      at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:96)
      at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
      [....]
      
      Caused by: java.lang.IllegalArgumentException: Too many entities. Was: 1050, limit: 1000
      at com.atlassian.jira.entity.property.JsonEntityPropertyManagerImpl.getPropertiesInternal(JsonEntityPropertyManagerImpl.java:207)
      at com.atlassian.jira.entity.property.JsonEntityPropertyManagerImpl.get(JsonEntityPropertyManagerImpl.java:201)
      at com.atlassian.jira.entity.property.BaseEntityPropertyService.getPropertiesWithoutPermissionCheck(BaseEntityPropertyService.java:166)
      at com.atlassian.jira.issue.changehistory.metadata.DefaultHistoryMetadataManager.getHistoryMetadata(DefaultHistoryMetadataManager.java:67)
      a...
      

      Notes

      Expanding any other property works fine:

      curl -D- -u EMAIL:PASSWORD -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"jql":"key=ISSUE-KEY", "expand": ["operations", "renderedFields", "versionedRepresentations", "editmeta"] }' https://INSTANCE/rest/api/2/search
      .....
      HTTP/1.1 200 OK
      ......
      
      {"expand":"names,schema","startAt":0,"maxResults":50,"total":1,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"22519","self":....
      ...
      

      Workaround

      We have recently added a new API endpoint to retrieve all the changelog entries for an issue:

      Please see the JIRA Cloud REST API Reference for details.

      Attachments

        Issue Links

          Activity

            People

              mkruszynski@atlassian.com Marcin Kruszynski (Inactive)
              dbonotto Dario B
              Votes:
              58 Vote for this issue
              Watchers:
              80 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: