Jason code to create a costom field

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 vote

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

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted an hour ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

9 views 0 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you