Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-69888

In JQL, when using "more than" (>) or "less than" (<) with the "id" field reference with an invalid issue id, the search will fail

    XMLWordPrintable

Details

    Description

      Summary

      Based on the Advanced searching, the "id" field reference supports these operators:

      • >
      • >=
      • <
      • <=

      This works as expected when specifying a valid issue id. For example, searching for "id < 10005" will correctly return issues with issue ids 10004, 10003, 10002, etc (if they exist).

      However, when using this operator, and specifying an invalid issue id (issue id does not exist), it is expected that the JQL should return the results, even though the specified issue id does not exist, instead of the search completely failing and returning no results. (Read "Steps to Reproduce" for more detailed information)

      Steps to Reproduce

      1. Go to issue navigator.
      2. Type in this query:
        id < 12345
        

      – Note: this issue id shouldn't refer to an existing issue id in the instance. If it does, change it to something else.

      Expected Results

      The JQL should return all issues with issue ids less than 12345. For example, 12344, 12343, etc.

      Actual Results

      The search fails, and this error message is returned:

      A value with ID '12345' does not exist for the field 'id'.

      Notes

      Also affects the REST API endpoint "GET /rest/api/2/search?jql". A "400 Bad Request" error will be returned.

      Workaround

      Rather than comparing with non-existing id find out the existing id where comparison would bring the same results. E.g. having ids of 1, 5 and 10, and intention to run jql id < 4, find the next id value of existing issue (5 in this case) and rewrite the jql to id < 5.

      Attachments

        Activity

          People

            Unassigned Unassigned
            msatriya Sadiq (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: