Plugins based on AbstractCustomFieldStatisticsMapper shows invalid URL in "Two Dimensional Filter Stats" gadget under "None" columns

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      NOTE: This bug report is for JIRA Cloud. Using JIRA Server? See the corresponding bug report.

      Our customer says:

      Tracing the JDVP (JIRA Database Values Plugin) implementation through to AbstractCustomFieldStatisticsMapper to the method getUrlSearchPrefix(). Within this method, it checks for "if (value != null)". In the not null scenario, it will enhance the passed SearchRequest to use:

      whereClauseBuilder.addStringCondition(JqlCustomFieldId.toString(customField.getIdAsLong()), getSearchValue(value))
      

      This appears to match the non-None behaviour where the expanded jqlQuery= parameter includes "cf[nnn] = <value id>".

      The else clause, however, has:

                      else
                      {
                          // Custom field cannot be shown on the issue navigator at this stage.
                          return null;
                      }
      

      It looks like the scenario was considered in the context of the issue navigator, but not considered in the case of the statistics gadgets?

      In my opinion - this "else" should properly enhance the search request to include something along the lines of "cf[nnn] IS EMPTY" within the jqlQuery= parameter? I think this would make the "None" column for these custom field values work properly?

      Our DoS has confirmed that this is indeed a bug and we should basically remove the:

      if (searcher.getSearchRenderer().isShown(user, combinedSearchContext)) 
      {...}
      else
      {
      // Custom field cannot be shown on the issue navigator at this stage.
      return null;
      }
      

      check.

      Also, we may want to deprecate this AbstractCustomFieldStatsmapper as well, since it isn't used internally and so plugin devs shouldn't use it either probably.

            Assignee:
            Unassigned
            Reporter:
            Clarissa Gauterio (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: