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

Error 500 viewing saved filter that searches for EMPTY in a Labels type field

    XMLWordPrintable

Details

    Description

      Issue Summary

      When accessing a saved filter with a search like "mylabels in(EMPTY)" where "mylabels" is a Labels type custom field, although the search works and the user is able to save the filter, returning to it afterward will return a 500 error.

      If this filter is used by an Agile Board, the filter can't be edited.

      This can be an intermittent behavior.

      Steps to Reproduce

      1. Create a new custom field of "Labels" type and name it "mylabels"
      2. Do a search for "mylabels in(EMPTY)"
      3. Save it as a new filter
      4. Navigate to "Manage Filters"
      5. Click on the saved filter

      Expected Results

      The filter and results are shown

      Actual Results

      500 Error page with the following error is shown:
      "Sorry, we had some technical problems during your last operation."

      The below exception is thrown in the "atlassian-jira.log" file:

       ERROR diegovb 1194x494x1 4z69ol 0:0:0:0:0:0:0:1 /issues/ [o.a.c.c.C.[.[localhost].[/j854].[action]] Servlet.service() for servlet [action] threw exception
      java.lang.ClassCastException: com.atlassian.query.operand.EmptyOperand cannot be cast to com.atlassian.query.operand.SingleValueOperand
      	at com.atlassian.jira.issue.search.searchers.transformer.CustomFieldLabelsSearchInputTransformer.getOperandValue(CustomFieldLabelsSearchInputTransformer.java:116)
      	at com.atlassian.jira.issue.search.searchers.transformer.CustomFieldLabelsSearchInputTransformer.getQueryInputPlaceHolder(CustomFieldLabelsSearchInputTransformer.java:100)
      	at com.atlassian.jira.issue.search.searchers.transformer.CustomFieldLabelsSearchInputTransformer.doRelevantClausesFitFilterForm(CustomFieldLabelsSearchInputTransformer.java:78)
      	at com.atlassian.jira.bc.issue.search.DefaultSearchService.calculateDoesQueryFitFilterForm(DefaultSearchService.java:370)
      	at com.atlassian.jira.bc.issue.search.DefaultSearchService.doesQueryFitFilterForm(DefaultSearchService.java:108)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy374.doesQueryFitFilterForm(Unknown Source)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy3116.doesQueryFitFilterForm(Unknown Source)
      	at com.atlassian.jira.components.query.DefaultSearcherService.searchWithJql(DefaultSearcherService.java:152)
      	... 3 filtered

      It also happens when adding other values to the search "mylabels in (test, otherlabel, EMPTY)"
      The problem does not happen when searching for "mylabels is EMPTY"
      It also does not happen with the default "labels" field

      Workaround

      The filter can be accessed when it is displayed on the Favourites bar on the left.
      To fix the filter do:

      1. Go to Manage Filter
      2. Search for the filter that can be viewed
      3. Add it to your favorites by adding a star to it
      4. Click on any other filter that can be viewed correctly.
      5. Click the name of the filter now showing on the left panel as a favorite.
      6. Remove the "EMPTY" search and hit Enter to search.
      7. Save the filter

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbaeza@atlassian.com Diego Baeza
            Votes:
            6 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated: