-
Bug
-
Resolution: Fixed
-
Medium
NOTE: This bug report is for JIRA Software Cloud. Using JIRA Software Server? See the corresponding bug report.
Summary
JIRA returns a 500 internal server error when a user tries to create an issue with an Epic Link via REST API (/rest/api/2/issue). The problem happens on JIRA Software 7.1.1 and 7.1.2 while it does not on 7.1.0.
Steps to Reproduce
- Install fresh JIRA Software 7.1.1
- Create a new "Scrum software development" project
- Create an Epic
- Try to create a new issue with an Epic Link, which result in getting a 500 internal server error.
Expected Results
A new issue with an Epic Link is successfully created
Actual Results
Cannot create a new issue with an Epic Link, but get result in getting a 500 internal server error. This is the sample REST API request and response:
$ curl -D- -u <UserID>:<Password> -X POST --data '{"fields": { "project": { "key": "<Project_key>" }, "summary": "summary", "<Custom_field_id_of_epic_link>":"<issue_key_of_the_epic>", "description": "desc", "issuetype": { "name": "Bug" } } }}' -H "Content-Type: application/json" http://<BaseUrl>/rest/api/2/issue/ HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 X-AREQUESTID: 1021x404x1 X-ASEN: SEN-L6611168 Set-Cookie: JSESSIONID=5AECDF4D14DF1339B043124A438FFD02; Path=/XXXXX/; HttpOnly X-Seraph-LoginReason: OK Set-Cookie: atlassian.xsrf.token=B4DH-TUMF-DLE1-9O5A|1236334174851d430b6b6e29d58f90203a3019cd|lin; Path=/XXXXX X-ASESSIONID: 1w1ggyp X-AUSERNAME: <UserID> Cache-Control: no-cache, no-store, no-transform X-Content-Type-Options: nosniff Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 22 Mar 2016 08:01:48 GMT Connection: close {"errorMessages":["Internal server error"],"errors":{}}
And the following error is logged in atlassian-jira.log
2016-03-22 16:47:46,842 http-nio-17101-exec-21 ERROR admin 1007x400x1 13ytstb 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:498) 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) ... 15 filtered at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37) ... 74 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.greenhopper.service.issuelink.EpicServiceImpl.addIssuesToEpic(EpicServiceImpl.java:90) at com.atlassian.greenhopper.customfield.epiclink.EpicLinkRestFieldOperationsHandler.update(EpicLinkRestFieldOperationsHandler.java:104) at com.atlassian.greenhopper.customfield.epiclink.EpicLinkRestFieldOperationsHandler.handleOperation(EpicLinkRestFieldOperationsHandler.java:76) at com.atlassian.greenhopper.customfield.epiclink.EpicLinkRestFieldOperationsHandler.updateIssueInputParameters(EpicLinkRestFieldOperationsHandler.java:64) at com.atlassian.jira.rest.v2.issue.IssueInputParametersAssembler$IssueInputParametersBuilder.finalizeIssueInputParams(IssueInputParametersAssembler.java:428) 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) ... 210 more
Workaround
Update the Epic Link Field after the ticket has been created. This can be done via REST API
- relates to
-
JSWCLOUD-13429 Create issue from Confluence not working when linked to epic
- Closed