java.lang.NullPointerException when Creating Issue via REST API

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

Creating an issue via REST API in a specific project doesn't work but manual issue creation (UI) works fine.

The following appears in the atlassian-jira.log

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2016-06-30 15:59:48,536 http-nio-8718-exec-3 ERROR admin 959x758x1 1prubon 0:0:0:0:0:0:0:1 /rest/api/2/issue/ [c.a.j.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(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:192) ... 4 filtered at com.atlassian.jira.rest.exception.ExceptionInterceptor.intercept(ExceptionInterceptor.java:55) ... 1 filtered at com.atlassian.jira.rest.v2.issue.scope.RequestScopeInterceptor.intercept(RequestScopeInterceptor.java:39) ... 14 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154) ... 1 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68) ... 86 filtered at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70) ... 16 filtered at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37) ... 73 filtered at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at com.atlassian.jira.rest.v2.issue.AbstractMetaFieldBeanBuilder.getFieldMetaBean(AbstractMetaFieldBeanBuilder.java:123) at com.atlassian.jira.rest.v2.issue.AbstractMetaFieldBeanBuilder.build(AbstractMetaFieldBeanBuilder.java:94) at com.atlassian.jira.rest.v2.issue.CreateMetaFieldBeanBuilder.build(CreateMetaFieldBeanBuilder.java:61) at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.getValidFieldsForCreate(IssueInputParametersAssembler.java:476) at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.buildForCreate(IssueInputParametersAssembler.java:287) at com.atlassian.jira.rest.v2.issue.CreateIssueResource.createIssue(CreateIssueResource.java:49) at com.atlassian.jira.rest.v2.issue.IssueResource.createIssue(IssueResource.java:596) ...

Diagnosis

  • POSTMAN results to "Internal Server Error" and 500 error

  • Creating an issue via UI works fine

  • Syntax seems to be correct and creates an issue in other projects successfully.

Cause

  • Custom field created out of a third party plugin JIRA Misc Custom Fields is causing the issue

Solution

Resolution

  • Disabling the third party plugin JIRA Misc Custom Fields allows issue creation via REST API.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.