Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-14623

Creating issue with epic link field through REST causes 500 Internal Error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • 7.1.4
    • 6.7.14
    • REST API
    • JIRA 6.4.x and JIRA Agile 6.7.14

      Summary

      Setting the epic link field to null or a specific value causes the failure. The issue affect both remove and add issue (during the issue creation) to the Epic via the REST API.

      Steps to Reproduce

      Run REST call, eg:

      curl -v -uuser:pass -X POST -H 'Content-Type: application/json' -d '{"fields":{"summary":"test","issuetype":{"id":"1"},"project":{"id":"10300","key":"AG"},"customfield_10401":"AG-3" }}' http://127.0.0.1:8080/rest/api/latest/issue
      

      note, call with payload without EpicLink (customfield_10401) is fine:

      '{"fields":{"summary":"test","issuetype":{"id":"1"},"project":{"id":"10300","key":"AG"} }}'
      

      Expected Results

      Works fine

      Actual Results

      .../rest/api/latest/issue?
      Request type: POST
      Content type: application/json
      Post data: {"fields":{"summary":"xxx","issuetype":{"id":"1"},"customfield_11261":"XXX-123","project":{"id":"51125","key":null}}}
      Response code: 500, message: Internal Server 
      {"errorMessages":["Internal server error"],"errors":{}}
      

      Exception in logs:

      2016-08-16 18:18:42,000 http-bio-8080-exec-11 ERROR admin 1098x560x1 4v7btn 127.0.0.1 /rest/api/latest/issue [jira.rest.exception.ExceptionInterceptor] Returning internal server error in response
      java.lang.reflect.InvocationTargetException
      ...
      Caused by: java.lang.NullPointerException
              at com.atlassian.greenhopper.service.issuelink.EpicServiceImpl.addIssuesToEpic(EpicServiceImpl.java:86)
              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:470)
      ...
      

      Notes

      Looks like a regression caused by JSW-10333. Works ok on JIRA Agile 6.7.12.

      Fixed in JIRA 7.1.4 - see https://jira.atlassian.com/browse/JSW-13407

              Unassigned Unassigned
              bob.swift@charter.net Bob Swift (personal)
              Votes:
              10 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: