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

Retain the extra bracket on the advanced search when saving a filter

    • 2
    • 13
    • 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.

      At the moment, when making a filter using the Advanced Search, the saved filter will remove the extra bracket if it's not needed. For example, let say the filter is originally:

      (Project = DEMO AND (status = Open OR Assignee = "admin"))
      

      The above filter will be saved as:

      Project = DEMO AND (status = Open OR Assignee = "admin")
      

      There is a reason why a user intentionally adds the additional bracket on the query, so that future changes on the JQL query will be easier.

      Another Example, such as complex JQL query is:
      Before the filter is saved:

      After the query is saved into a filter:

        1. beforesavedfilter.png
          beforesavedfilter.png
          33 kB
        2. savedfilter.png
          savedfilter.png
          32 kB
        3. screenshot-1.png
          screenshot-1.png
          121 kB

          Form Name

            [JRACLOUD-31088] Retain the extra bracket on the advanced search when saving a filter

            I am having this issue currently on swimlane filtering where I want something like:

            (type = Bug and priority != New) or (type = Task and priority = New)

            which gets replaced completed as

            type = Bug and priority != New or type = Task and priority = New

            Which is not logically the same.

            Christopher Lee added a comment - I am having this issue currently on swimlane filtering where I want something like: (type = Bug and priority != New) or (type = Task and priority = New) which gets replaced completed as type = Bug and priority != New or type = Task and priority = New Which is not logically the same.

            Italo Lobato added a comment - - edited

            This also happens when we use a JQL setting the precedence with parenthesis in the project Queue (see PCS-293173 support ticket with more details)

            Italo Lobato added a comment - - edited This also happens when we use a JQL setting the precedence with parenthesis in the project Queue (see PCS-293173 support ticket with more details)

            Hi 8541f0f605d9 if you can reproduce this bug, can you please let me know what your JQL query is? As discussed, I was unable to reproduce the problem using the example from the Description.

            Anusha Rutnam added a comment - Hi 8541f0f605d9 if you can reproduce this bug, can you please let me know what your JQL query is? As discussed , I was unable to reproduce the problem using the example from the Description.

            The bug is still active. Please fix it.

            Fabian Petzold added a comment - The bug is still active. Please fix it.

            Atlassian Update - January 2024

            As I did not receive any responses to this comment I am closing this ticket.

            If you do not think this issue should have been closed, please add a comment here saying why and we can reopen it.

            Anusha Rutnam added a comment - Atlassian Update - January 2024 As I did not receive any responses to this comment I am closing this ticket. If you do not think this issue should have been closed, please add a comment here saying why and we can reopen it.

            Can the watchers of this issue still reproduce the described behaviour? I cannot - here is my saved filter with JQL containing the double closing bracket:

            If you can repro, please let me know what your JQL query is, thank you!

            Anusha Rutnam added a comment - Can the watchers of this issue still reproduce the described behaviour? I cannot - here is my saved filter with JQL containing the double closing bracket: If you can repro, please let me know what your JQL query is, thank you!

            This issue is considered an improvement to the JQL search interaction, as the brackets removed when the filter is saved are redundant. The simplified query is semantically equivalent to the original query. Both original JQL query and its simplified version (with redundant brackets removed) would return the same results. The process of simplification takes operator precedence into the account, see https://confluence.atlassian.com/jiracoreserver084/advanced-searching-979408017.html#Advancedsearching-parenthesesPrecedenceinJQLqueries.

             

            There is a clear evidence though that the redundant bracket removal on filter saving is causing confusion amongst the users. I can see how redundant brackets added to the query may improve the readability of the query and clarify its intension better. This is what we are considering a possible improvement here, to revisit the need of query simplification and the way it is performed.

            Piotr Swiecicki added a comment - This issue is considered an improvement to the JQL search interaction, as the brackets removed when the filter is saved are redundant. The simplified query is semantically equivalent to the original query. Both original JQL query and its simplified version (with redundant brackets removed) would return the same results. The process of simplification takes operator precedence into the account, see https://confluence.atlassian.com/jiracoreserver084/advanced-searching-979408017.html#Advancedsearching-parenthesesPrecedenceinJQLqueries .   There is a clear evidence though that the redundant bracket removal on filter saving is causing confusion amongst the users. I can see how redundant brackets added to the query may improve the readability of the query and clarify its intension better. This is what we are considering a possible improvement here, to revisit the need of query simplification and the way it is performed.

            Not sure how this is a suggestion for JSQL improvement, it is a basic feature that should be supported

            Mark Sadegursky added a comment - Not sure how this is a suggestion for JSQL improvement, it is a basic feature that should be supported

            Alastair Burr added a comment - - edited

            Yes, please can this be looked at, as John is right it appears to be changing the intent in a number of ours!! The placement of the brackets, ANDs and ORs are very important and it appears to be removing brackets around some of the fields AND'ed causing the ORs to have a different meaning!!

            Alastair Burr added a comment - - edited Yes, please can this be looked at, as John is right it appears to be changing the intent in a number of ours!! The placement of the brackets, ANDs and ORs are very important and it appears to be removing brackets around some of the fields AND'ed causing the ORs to have a different meaning!!

            I am finding that brackets being removed is changing the intent of my advanced queries.
            e.g. This:
            project = BSP AND component = "Patient Management" AND ((issuetype = Requirement AND issueKey in linkedIssues(BSP-1116)) OR (issueKey = BSP-1116))
            is changed to this:
            project = BSP AND component = "Patient Management" AND (issuetype = Requirement AND issueKey in linkedIssues(BSP-1116) OR issueKey = BSP-1116)
            It seems to be working the same but the second is not what I want and doesn't seem to be correct.

            i.e. First:
            ((issuetype = Requirement AND issueKey in linkedIssues(BSP-1116))
            OR
            (issueKey = BSP-1116))
            Second:
            (issuetype = Requirement
            AND
            issueKey in linkedIssues(BSP-1116)
            OR
            issueKey = BSP-1116)

            John Beltman added a comment - I am finding that brackets being removed is changing the intent of my advanced queries. e.g. This: project = BSP AND component = "Patient Management" AND ((issuetype = Requirement AND issueKey in linkedIssues(BSP-1116)) OR (issueKey = BSP-1116)) is changed to this: project = BSP AND component = "Patient Management" AND (issuetype = Requirement AND issueKey in linkedIssues(BSP-1116) OR issueKey = BSP-1116) It seems to be working the same but the second is not what I want and doesn't seem to be correct. i.e. First: ((issuetype = Requirement AND issueKey in linkedIssues(BSP-1116)) OR (issueKey = BSP-1116)) Second: (issuetype = Requirement AND issueKey in linkedIssues(BSP-1116) OR issueKey = BSP-1116)

              Unassigned Unassigned
              isiagian Immanuel Siagian (Inactive)
              Votes:
              21 Vote for this issue
              Watchers:
              21 Start watching this issue

                Created:
                Updated: