Calling POST /rest/api/3/jql/match with assignee in JQL returns incorrect match result

XMLWordPrintable

    • Severity 2 - Major

      Issue Summary

      Calling POST /rest/api/3/jql/match with assignee in JQL (like assignee = Vitaliy Ushanov) returns no matches when POST /rest/api/3/search shows the JQL should match.

      Steps to Reproduce

      1. User “Vitaliy Ushanov” in Jira is assigned to the issue with id 10618. Replace user name and issue id in steps below.
      2. POST to the search api with body:
        {
          "expand": [
            "names"
          ],
          "jql": "assignee = \"Vitaliy Ushanov\"",
          "maxResults": 15,
          "fieldsByKeys": false,
          "fields": [
            "assignee"
          ],
          "startAt": 0
        }
        

        Confirm results in json similar to:

        {
            "expand": "schema,names",
            "startAt": 0,
            "maxResults": 15,
            "total": 27,
            "issues": [
                {
                    "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
                    "id": "10618",
                    ...
        

        Note the first issue found.

      3. POST to the match api with body (using the same jql and the issue noted from first step above):
        {
            "issueIds": [
        	10618
            ],
            "jqls": [
        	"assignee = \"Vitaliy Ushanov\""
            ]
        }
        

      Expected Results

      The expected result is the issue matches similar to:

      {
          "matches": [
              {
                  "matchedIssues": [
                      10618
                  ],
                  "errors": []
              }
          ]
      }
      

      Actual Results

      The actual result is no matches are found.

      {
          "matches": [
              {
                  "matchedIssues": [],
                  "errors": []
              }
          ]
      }
      

      Single quotes in name (‘Vitaliy Ushanov’) don’t help.

      Workaround

      Replace full user name in jql by its id in request body:

      {
          "issueIds": [
      	10618
          ],
         "jqls": [
      	"assignee = 5d2f56472d76f30c36bf88ce"
          ]
      }
      

      Now the match result is correct and the issue with id 10618 is found:

      {
          "matches": [
              {
                  "matchedIssues": [
                      10618
                  ],
                  "errors": []
              }
          ]
      }
      

      The problem with this as "workaround" is this isn't the actual JQL that works in both UI and search API.

            Assignee:
            Grzegorz Lewandowski
            Reporter:
            devpartisan
            Votes:
            10 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: