The notify rest api endpoint returns status code 500 instead of 400 if there are errors in the request body

XMLWordPrintable

    • Minor

      Issue Summary

      Sending a POST request to the /rest/api/3/issue/{issueIdOrKey}/notify REST API endpoint returns status code 500 (Internal Server Error) instead of 400 (Bad Request) in case of errors in the request body.

      Steps to Reproduce

      1. Send a POST REST API request to the with below body to the issue notify endpoint *https://SITENAME.atlassian.net/rest/api/3/issue/ISSUE-KEY/notify*
        { 
        "subject": "Test Email", 
        "textBody": "Body", 
        "htmlBody": "<h1>Body</h1>", 
        "to": 
          { "voters": false, 
            "assignee": true, 
            "watchers": false, 
            "reporter": true
          }
        }
        
      2. See that the request works fine (returning status code 204) and that assignee and reporter of the issue having key  ISSUE-KEY receive a notification as expected.
      3. Now send below (wrong) body to the same endpoint:
        { 
        "subject": "Test Email", 
        "textBody": "Body", 
        "htmlBody": "<h1>Body</h1>", 
        "to": 
          { "voters": false, 
            "assignee": false, 
            "watchers": false, 
            "reporter": false, 
            "groups": null 
          }
        }
        

      Expected Results

      Status code 400 (Bad request) is returned

      Actual Results

      Status code 500 (Internal Server Error) is returned instead

      Workaround

      No workaround available at the moment.

            Assignee:
            Unassigned
            Reporter:
            Dario B
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: