Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-65345

Upgrade to JIRA is breaking boards using the NOT with WAS IN JQL operators in their filter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.2.0, 7.2.1, 7.3.0, 7.2.2, 7.2.3, 7.2.6, 7.2.7, 7.2.8, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.6, 7.5.4, 7.2.4
    • JQL
    • None

    Description

      Summary

      Upgrade to JIRA is breaking boards using the NOT with WAS IN JQL operators in their filter

      Environment

      • Problem appears to happen on environments upgrading from 7.1.x (or possibly earlier versions) to 7.2/7.3 versions

      Steps to Reproduce

      1. Install JIRA 7.1.9, with JIRA Software
      2. Create a saved filter with the operators "NOT" that precedes the "WAS IN" (here is an example
        "project = ABC AND NOT (Status was in (Done, Resolved) before -30d AND status in (Done, Resolved)) AND assignee = user1 ORDER BY Rank ASC" 
        
      3. Create a new board based off this saved filter
      4. upgrade JIRA to 7.2.8 or 7.3.x

      Expected Results

      JIRA is able to load these boards as expected

      Actual Results

      1. Trying to use the issue navigator when using both "NOT" and "WAS IN" in the same JQL query throws an error
      2. You are unable to list all the boards in JIRA when going to Boards -> View all boards. (The system just appears to spin and wait forever)
      3. JIRA throws a 500 page error when tried to either visit the problem board directly, or even trying to visit the associated project landing page
        Technical details
        Log's referral number: 95768191-b294-4121-bb17-df48bdb9c09a
        Cause
        Referer URL: http://localhost:8080/plugins/servlet/project-config/ABC/roles
        java.lang.RuntimeException: java.lang.IllegalArgumentException: Unrecognized operator: WAS_IN
        java.lang.RuntimeException: java.lang.IllegalArgumentException: Unrecognized operator: WAS_IN
        	at com.atlassian.web.servlet.plugin.DynamicAuthorizationServletForwarder.forward(DynamicAuthorizationServletForwarder.java:55) [?:?]
        	at com.atlassian.web.servlet.plugin.DynamicAuthorizationServletForwarder.forwardSafely(DynamicAuthorizationServletForwarder.java:83) [?:?]
        	at com.atlassian.web.servlet.plugin.SanitizingServletForwarder.forwardSafely(SanitizingServletForwarder.java:48) [?:?]
        	at com.atlassian.web.servlet.plugin.RememberingServletForwarder.forwardSafely(RememberingServletForwarder.java:75) 
        

      Notes

      • This query works in JIRA 7.1.x and before
      • The error appears to include an underscore in the operator Unrecognized operator: WAS_IN, however when looking at the SQL data there does not appear to be an underscore in the query at all. Hence there must be some other check/validation process within JIRA that is either adding this underscore, or is incorrectly checking for the valid operator of "WAS IN".
      • Advanced searching - operators reference - Atlassian Documentation still list WAS IN as a valid operator.
      • However instead I think we should be using the WAS NOT IN operator here, rather than trying to negate the current WAS IN operator

      Workaround

      1. You can find the filters in your environment that are using this with a query such as
        select * from searchrequest where reqcontent like '%was in%' and reqcontent like '%not%'; 
        
      2. It would be best to create a backup of your data before doing anything else
      3. You will need to edit the filter query within SQL in order to change the JQL query. It would be best for you to note the current values for these filters now.
        Old JQL query:
        project = ABC AND NOT (Status was in (Done, Resolved) before -30d AND status in (Done, Resolved)) AND assignee = user1 ORDER BY Rank ASC 
        

        New JQL query:

        project = ABC AND (Status was not in (Done, Resolved) before -30d AND status not in (Done, Resolved)) AND assignee = user1 ORDER BY Rank ASC 
        

        You could do this with a SQL query such as

        update searchrequest set reqcontent='project = ABC AND (Status was not in (Done, Resolved) before -30d AND status not in (Done, Resolved)) AND assignee = user1 ORDER BY Rank ASC' where id=99999; 
        

        (where the id 99999 value is the id value of the filter returned in the first sql select statement)

      4. with the filter changed in SQL, restart JIRA
      5. This should allow the boards to load correctly.

      Attachments

        1. result in 71x.PNG
          result in 71x.PNG
          40 kB
        2. result in 73x.PNG
          result in 73x.PNG
          26 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aheinzer Andy Heinzer
              Votes:
              14 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated: