Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-2708

Custom REST Endpoint : trows NullPointerException with DELETE method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.3.6
    • Fix Version/s: 5.3.9
    • Component/s: None
    • Labels:
      None
    • Critical Points:
      0.7

      Description

      1. Create a delete rest end point
      2. import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
        import groovy.json.JsonBuilder
        import groovy.transform.BaseScript
        
        import javax.ws.rs.core.MultivaluedMap
        import javax.ws.rs.core.Response
        
        @BaseScript CustomEndpointDelegate delegate
        
        myDelete( httpMethod: "DELETE", groups: ["jira-administrators"] ) { MultivaluedMap queryParams, String body ->
        return Response.ok().build()
        }
        
        
      1. curl -X "DELETE" -u admin:admin http://localhost:8080/jira/rest/scriptrunner/latest/custom/myDelete

      Reason : content is null for delete request and content.size() is throwing the exception.

        Attachments

          Activity

            People

            Assignee:
            ahasan Ashraful Hasan [X] (Inactive)
            Reporter:
            ahasan Ashraful Hasan [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: