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

Less than or equal to (<=) operator does not work correctly towards dates

    • 19
    • 32
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Problem Definition

      The functionality of the operator Less than or equal to (<=) is not working correctly towards dates.

      JIRA will return the issues that were created before the specified date, but not the ones created on that date.

      For example, issue created on 1 April 2018 can’t be found using the below JQL

      createdDate <=2018-04-01
      

      This is because it will search for issues that are created before 2018-04-01 00:00:00.

      Steps to reproduce

      • Create an issue via CSV, with created date = 2018-04-01;
      • Search for: createdDate <=2018-04-01.

      Expected results

      The issue with created date 2018-04-01 will be returned in the search.

      Actual results

      The issue with created date 2018-04-01 is not returned in the search.

      Workaround

      Search for the date 1 day after the desired one.

      For example, you want to look for issues that were created at or before 2018-04-01:

      • createdDate <2018-04-02.

            [JRACLOUD-71435] Less than or equal to (<=) operator does not work correctly towards dates

            This is not a suggestion; it is a product bug.

            Users should not be expected to search using a timestamp when a date function is available.

            We would appreciate it if this could be addressed as a priority.

            Vignesh Jayagopal added a comment - This is not a suggestion; it is a product bug. Users should not be expected to search using a timestamp when a date function is available. We would appreciate it if this could be addressed as a priority.

            Jira Team, if you are not able to correct such fundamental thing for almost 6 years, then remove it from the doc and make JQL to generate error as not supported ones! It looks like a bad joke. Think this way: let say we have a calculator. Oh dear, 2+2 doesn't give 4, so lets gather interest if anyone wants it to be fixed Oh c'mon!

            Bogdan Slusarczyk added a comment - Jira Team, if you are not able to correct such fundamental thing for almost 6 years, then remove it from the doc and make JQL to generate error as not supported ones! It looks like a bad joke. Think this way: let say we have a calculator. Oh dear, 2+2 doesn't give 4, so lets gather interest if anyone wants it to be fixed Oh c'mon!

            I'm surprised that such a significant bug hasn't been fixed for so long.

            Alexander Popov added a comment - I'm surprised that such a significant bug hasn't been fixed for so long.

            The solution is a bit simpler I think.

            When doing a JQL on a date (i.e. Search for: createdDate <=2018-04-01) Jira displays results for tickets created up until 12pm that day...

            It is simply that the developer behind this made a mistake and used 12pm instead of 12am. This is confirmed. I have done different JQLs for updateddate and tickets being updated at 13:35 were not shown in the results, whereas tickets updated 9:29 were. You can try different searches with different date fields and you always get this behaviour. 

            Roberto Enjuanes added a comment - The solution is a bit simpler I think. When doing a JQL on a date (i.e. Search for: createdDate <=2018-04-01) Jira displays results for tickets created up until 12pm that day... It is simply that the developer behind this made a mistake and used 12pm instead of 12am . This is confirmed. I have done different JQLs for updateddate and tickets being updated at 13:35 were not shown in the results, whereas tickets updated 9:29 were. You can try different searches with different date fields and you always get this behaviour. 

            Data types exist
            To solve this exact problem
            How is this a thing?

            "Date" and "Datetime" are, by definition, not the same thing. Why is this function constructed so poorly that it doesn't know (and handle) the difference? At the very least throw an error - making a silent bad decision is the worst possible choice.

            Haddon Fisher added a comment - Data types exist To solve this exact problem How is this a thing? "Date" and "Datetime" are, by definition, not the same thing. Why is this function constructed so poorly that it doesn't know (and handle) the difference? At the very least throw an error - making a silent bad decision is the  worst  possible choice.

            pswiecicki  even trying to include date and time it doesn't work.

            There is no way to find issues created in a specific day (example created="2022-06-16 16:02" or created="2022-06-16"). The only way is to use created > 2022-06-15 and created < 2022-06-17

            Greice Faustino (Inactive) added a comment - pswiecicki   even trying to include date and time it doesn't work. There is no way to find issues created in a specific day (example created="2022-06-16 16:02" or created="2022-06-16" ). The only way is to use created > 2022-06-15 and created < 2022-06-17

            This seems like a reasonable expectation to parse the date literal differently, according to the operator used, if no time part was provided.   Yet such change may bring undesired impact on the current integrations and use cases.  

            I have corrected the issue type to Suggestion, let's see how much interest this issue would gather.

            Piotr Swiecicki added a comment - This seems like a reasonable expectation to parse the date literal differently, according to the operator used, if no time part was provided.   Yet such change may bring undesired impact on the current integrations and use cases.   I have corrected the issue type to  Suggestion , let's see how much interest this issue would gather.

              Unassigned Unassigned
              akaurtuteja Ammrit Preet Kaur Tuteja (Inactive)
              Votes:
              31 Vote for this issue
              Watchers:
              33 Start watching this issue

                Created:
                Updated: