Using "'assignee WAS" in JQL for Search REST API gives bad request when user doesn't exists

XMLWordPrintable

    • Type: Bug
    • Resolution: Low Engagement
    • Priority: Low
    • None
    • Affects Version/s: 7.3.2, 7.12.1
    • Component/s: REST API
    • 7.03
    • 1
    • Severity 3 - Minor
    • 0

      Summary

      If a user doesn't exist and you use a rest call like /rest/api/2/search?jql=assignee was admin, then Jira will return 400 Bad Request error rather than a warning that the user doesn't exist.

      Steps to Reproduce

      1. Create a TestUser
      2. Create an issue, and assign it to TestUser
      3. Assign the issue to another user, or unassign it
      4. Delete the TestUser account
      5. Execute the following REST call (since it's a GET, you can browse to it directly):
        $jira-url/rest/api/2/search?jql=assignee%20was%20testuser
        

      Expected Results

      The REST API should return a 200 OK response, with the warning message that the user does not exist. This is the behaviour when the query is assignee = testuser for example.

      Actual Results

      The REST API returns a 400 Bad Request response, with the warning message that the user does not exists.

      Workaround

      Performing a POST with the JQL as JSON data should return the results correctly. For example:

      curl -X "POST" "http://localhost:47121/j7121/rest/api/2/search" \
           -u 'username:password' \
           -d $'{"jql": "assignee was testuser"}'
      

      Notes

      We notice the same issue in the UI too, where '=' is a warning and 'was' is an error

        1. equal.png
          equal.png
          44 kB
        2. was.png
          was.png
          37 kB

            Assignee:
            Unassigned
            Reporter:
            Mohamed Riza (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: