rest/api/3/jql/autocompletedata does not return cfid attribute for ambiguously named custom fields

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      When calling the /rest/api/3/jql/autocompletedata, if a custom field is ambiguously named (e.g. there are multiple fields that share the same name), then the cfid attribute is not returned in the API response. Instead, the cfid value will be part of the value attribute. 

      An example of a custom field returning the full expected JSON: 

          {
            "value": "alsProjectSelectors",
            "displayName": "alsProjectSelectors - cf[10091]",
            "auto": "true",
            "orderable": "true",
            "searchable": "true",
            "cfid": "cf[10091]",
            "operators": [
              "=",
              "!=",
              "in",
              "not in",
              "is",
              "is not"
            ],
            "types": [
              "com.atlassian.jira.issue.customfields.option.Option"
            ]
          },

      Example of two custom fields that share the same name: 

            "value": "cf[10095]",
            "displayName": "Alz project picker - cf[10095]",
            "auto": "true",
            "orderable": "true",
            "searchable": "true",
            "operators": [
              "=",
              "!=",
              "in",
              "not in",
              "is",
              "is not"
            ],
            "types": [
              "com.atlassian.jira.project.Project"
            ]
          },
          {
            "value": "cf[10108]",
            "displayName": "Alz project picker - cf[10108]",
            "auto": "true",
            "orderable": "true",
            "searchable": "true",
            "operators": [
              "=",
              "!=",
              "in",
              "not in",
              "is",
              "is not"
            ],
      • Notice all 3 custom fields are the same fieldType.
      • However, the 2 fields that share the same name do not have the cfid attribute. Instead, the value attribute will reference the cfid string

      Steps to Reproduce

      1. In a Jira Cloud site, create 2+ custom fields that share the same name
      2. Call the /rest/api/3/jql/autocompletedata endpoint, and locate those fields 
      3. The API will not include the cfid attribute for those fields 

      Expected Results

      • Fields that share the same name should still return cfid's, because these are unique identifiers

      Actual Results

      • Fields that share the same name do not include the cfid attribute.
      • Instead, the value attribute will reference the cfid

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Alan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: