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

JQL query search using "status was" returns incorrect unreliable results for Team and Company Managed projects

    XMLWordPrintable

Details

    Description

      Summary

      For team and company managed projects, when searching for issues using JQL such as:

      project = PROJECT_NAME AND (status CHANGED FROM "To Do" OR status = "To Do")
      
      status was "In Progress" after "2022-03-09" AND status in ("Ready for Release", Done, Closed, Declined, Postponed)
      
      status was "In Progress" after endOfDay(-21d) AND status in ("Ready for Release", Done, Closed, Declined, Postponed)
      
      assignee WAS currentUser() AFTER "2022-01-01" AND project = "DEMO"
      

      If JQL contains "WAS" and AFTER or endOfDay it ** does not consider the timeline and returns all results.

      The results are unreliable.

      Steps to Reproduce

      • Work case 1
      1. Create a  project with statuses "To Do", "In Progress" and "Done".
      2. Create some issues, and transition some of them around.
      3. Run the query: project = PROJECT_NAME AND (status CHANGED FROM "To Do" OR status = "To Do")
      4.  Run the query  status was "In Progress" after endOfDay(-2d) 
      • Work case 2
      1. Have or create several issues in and outside of the required parameters 
      2. Run the query status was "In Progress" after endOfDay(-21d) AND status in ("Ready for Release", Done, Closed, Declined, Postponed)

      Expected Results

      • Only issues in the specified parameters should be returned.

      Actual Results

      • Issues not in the specified parameters are returned

      Notes

      We primarily see this happening in these scenarios:

      • The search doesn't work with team-managed projects
      • The search doesn't work well in company-managed projects when there has been a workflow change

      In both scenarios, using the status_id instead of the status_name works. This also affects searches performed via the Jira APIs.

      Workaround

      Use the Status Id instead of Status name when using was or changed in JQL.

      How to get the Status Id?

      • For company-managed projects:
        • Navigate to the Statuses page by going to Settings -> Issues -> Statuses.
        • Hover your mouse over the "edit" button of the Status you want to use.
        • Grab the Id value from the URL the browser shows, typically in the bottom left corner

      The above workaround does not work if the JQL query has "WAS" and AFTER or endOfDay 

      In the JQL replace the Statuses name with the Ids you want to use. For example:

      status was 10001

      or 

      status changed to 10001

      Attachments

        Issue Links

          Activity

            People

              pswiecicki Piotr Swiecicki
              mtokar Michael Tokar
              Votes:
              90 Vote for this issue
              Watchers:
              99 Start watching this issue

              Dates

                Created:
                Updated: