-
Bug
-
Resolution: Fixed
-
Low
-
None
Summary
JIRA Software allows the Epic Status field to be edited, which causes a NullPointerException when running calling:
GET /rest/agile/1.0/board/{boardId}/epic/{epicId}/issue
GET /rest/agile/1.0/board/{boardId}/sprint/{sprintId}/issue
as EpicServiceImpl.getEpicStatusValue(issue) expects an Epic Status to exist.
Steps to Reproduce
- Create an Epic and browse to it.
- Select 'Edit';
alternatively, Select 'Admin > Add Field' - Edit the Epic Status to none
Expected Results
- It would not be possible to change the Epic Status to none;
- Or the endpoints wouldn't return a 500 error when parsing Epics with no statuses.
Actual Results
The below exception is thrown in the atlassian-jira.log file or as a response on the API call:
2015-10-12 17:32:04,109 ajp-nio-8077-exec-2 ERROR matheus 1052x9377x1 13woces 192.168.10.96 /rest/agile/1.0/board/1/epic/10107/issue [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null java.lang.NullPointerException at com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpicStatusValue(EpicServiceImpl.java:221) at com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.getEpic(EpicServiceImpl.java:171) at com.atlassian.greenhopper.api.rest.BoardEpicResource$2.apply(BoardEpicResource.java:205) at com.atlassian.greenhopper.api.rest.util.IssueResourceHelper$1.apply(IssueResourceHelper.java:125) at com.atlassian.greenhopper.api.rest.util.BoardResourceHelper.executeWithBoard(BoardResourceHelper.java:54) at com.atlassian.greenhopper.api.rest.util.IssueResourceHelper.searchIssueByQueryParamsForBoard(IssueResourceHelper.java:112) at com.atlassian.greenhopper.api.rest.BoardEpicResource.getIssuesForEpic(BoardEpicResource.java:200) ... 3 filtered at java.lang.reflect.Method.invoke(Method.java:483) ... 19 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) ... 1 filtered at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) ... 41 filtered at com.atlassian.plugins.cors.CorsFilter.doFilter(CorsFilter.java:65) ... 64 filtered at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40) ... 72 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)
Workaround
- Search for all Epics with no status:
type = 'Epic' and "Epic Status" is EMPTY
- Manually (or bulk) edit those and add a value for the Epic Status field.