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

JIRA REST API returned a NPE error if stated wrong transition ID

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      When transit an issue to another state, we refer to the following transition ID found in the GET method JSON.

      For example:

      1. GET http://localhost:8080/rest/api/latest/issue/TEST-1/transitions
      2. The request returns the states 'Resolved' => '5', 'Closed' => '6', 'In Progress' => '3'.
      3. POST http://localhost:8080/rest/api/latest/issue/TEST-1/transitions
        {"transition":{"id":"7"}}
        
      4. This time with JSON data {"transition":{"id":"7"}} and get the '500 Internal Server Error' because transition ID = 7 is not exist.
        2015-01-21 17:54:29,343 http-bio-8080-exec-20 ERROR admin 1134x2089x1 xxxx xx.xx.xx.xx /rest/api/latest/issue/TEST-1/transitions [jira.rest.exception.ExceptionInterceptor] Returning internal server error in response
        java.lang.reflect.InvocationTargetException
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        	at java.lang.reflect.Method.invoke(Unknown Source)
        	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)
        	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)
        	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
        ...
        Caused by: java.lang.NullPointerException
        	at com.atlassian.jira.workflow.WorkflowActionsBean.getFieldScreenForView(WorkflowActionsBean.java:59)
        	at com.atlassian.jira.issue.fields.screen.StandardFieldScreenRendererFactory.getScreenFromAction(StandardFieldScreenRendererFactory.java:130)
        	at com.atlassian.jira.issue.fields.screen.StandardFieldScreenRendererFactory.createFieldScreenRenderer(StandardFieldScreenRendererFactory.java:55)
        	at com.atlassian.jira.issue.fields.screen.FieldScreenRendererFactoryImpl.getFieldScreenRenderer(FieldScreenRendererFactoryImpl.java:55)
        

      The NPE error is misleading to user and it would be great if JIRA can handle the error by showing a meaningful error message. Besides being misleading it seems to indicate that there is a bug in the error handling routines, and IMHO should be fixed.

      Attachments

        Issue Links

          Activity

            People

              istankiewicz Eve (Inactive)
              ckimloong John Chin
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: