Jason code to create a costom field

Roshan Surana May 15, 2016

Hi,

I want to create a custom field by using rest API. Currently I'm using below jason code to create a custom field 

{

"name": "New custom field",

"description": "Custom field for picking groups",

"type": "com.atlassian.jira.plugin.system.customfieldtypes:grouppicker",

"searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher"

 }

 

But when I'm trying to execute this code by using  curl command it throws below error.

image2016-5-16 14:14:33.png

Below is the log:

 

2016-05-16 14:29:19,891 http-nio-8080-exec-15 ERROR Abhaya 869x1979x1 1jnn3tk 10.11.61.24 /rest/api/2/issue/ [c.a.j.rest.exception.ExceptionInterceptor] Returning internal server error in response
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor1047.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:192)
at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:83)
... 3 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)
... 74 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.initProjectAndIssueType(IssueInputParametersAssembler.java:294)
at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.buildForCreate(IssueInputParametersAssembler.java:265)
at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler.makeCreateAssembler(IssueInputParametersAssembler.java:131)
at com.atlassian.jira.rest.v2.issue.CreateIssueResource.createIssue(CreateIssueResource.java:49)
at com.atlassian.jira.rest.v2.issue.IssueResource.createIssue(IssueResource.java:596)


 

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2016

Read the application log file to find out what is going wrong internally.  jira-home/logs/atlassian-jira.log

Roshan Surana May 15, 2016

image2016-5-16 14:31:1.png

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2016

Sorry, I can't read that.  Could you give us the plain text instead of a screenshot?

Suggest an answer

Log in or Sign up to answer