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

Using quotes/double quotes in select custom field value causes problem in Basic Search

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      1. Create a select custom field
      2. In one of the options of this custom field, add a javascript/html customisation, such as:
        <font size="1" color="red"><b>Test Value</b></font>
        
      3. Browse to the issue navigator
      4. In the Basic search mode, select the custom field and the custom field value you created

      Current behaviour

      A red internal server error message is presented (as shown in the attachments).

      In the logs you can find the following:

      java.lang.NumberFormatException: For input string: "Test Value" value="11201"> Test Value"
      	at java.lang.NumberFormatException.forInputString(Unknown Source)
      	at java.lang.Long.parseLong(Unknown Source)
      	at java.lang.Long.parseLong(Unknown Source)
      	at com.atlassian.jira.issue.customfields.searchers.renderer.MultiSelectCustomFieldSearchRenderer$1.apply (MultiSelectCustomFieldSearchRenderer.java:51)
      	at com.atlassian.jira.issue.customfields.searchers.renderer.MultiSelectCustomFieldSearchRenderer$1.apply (MultiSelectCustomFieldSearchRenderer.java:47)
      	at com.google.common.collect.Iterators$8.next(Iterators.java:782)
      	at java.util.AbstractCollection.addAll(Unknown Source)
      	at java.util.HashSet.<init>(Unknown Source)
      	at com.atlassian.jira.issue.customfields.searchers.renderer.MultiSelectCustomFieldSearchRenderer.getSelectedOptions (MultiSelectCustomFieldSearchRenderer.java:217)
      	at com.atlassian.jira.issue.customfields.searchers.renderer.MultiSelectCustomFieldSearchRenderer.getInvalidOptions (MultiSelectCustomFieldSearchRenderer.java:168)
      	at com.atlassian.jira.issue.customfields.searchers.renderer.MultiSelectCustomFieldSearchRenderer.getViewHtml (MultiSelectCustomFieldSearchRenderer.java:140)
      	at com.atlassian.jira.components.query.DefaultSearcherService.getValueResults(DefaultSearcherService .java:266)
      	at com.atlassian.jira.components.query.DefaultSearcherService.getViewHtml(DefaultSearcherService.java :130)
      	at com.atlassian.jira.components.query.QueryRendererValueAction.doDefault(QueryRendererValueAction.java :38)
      	at sun.reflect.GeneratedMethodAccessor1654.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
      	at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
      	at webwork.action.ActionSupport.invokeCommand(ActionSupport.java:438)
      	at webwork.action.ActionSupport.execute(ActionSupport.java:157)
      	at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:87)
      	at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
      	at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
      	at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
      	at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
      	at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:225)
      	at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:154)
      	at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher .java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java :87)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at com.atlassian.jira.web.filters.XContentTypeOptionsNoSniffFilter.doFilter(XContentTypeOptionsNoSniffFilter .java:22)
      	at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      

      Expected behaviour

      Render the custom field in Basic search as it does in Advanced search or when you use html/javascript without quotes or double quotes.

      Workaround

      Option 1:

      Search for the custom field in the "Advanced mode" instead of Basic.
      You can also search for the custom field in Advanced and then switch back to Basic, which will then render the field properly.

      Option 2:

      Change the value so you don't need to use quotes or double quotes, as in:

      • Instead of:
        <font color="red"><b>Critical Defect</b></font>
        
      • Use:
        <font color=#FF0000><b>Test Value</b></font>
        

      Attachments

        Activity

          People

            Unassigned Unassigned
            pschaff Pietro Schaff (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: