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

Update field configuration API endpoint limits description to 1000 characters but the UI doesn't

      Issue Summary

      PUT /rest/api/3/fieldconfiguration/$id/fields update rest API endpoint limits description to 1000 characters.
      However, it's possible to update description of a customfield to more than 1000 characters using GUI [/secure/admin/EditFieldLayoutItem!default.jspa].
      If a description is more than 1000 characters (set by using the UI), GET /rest/api/3/fieldconfiguration/$id/fields will still return the full description in the response.

      This creates a discrepancy in the expected bahaviour between UI and the APIs (even with different HTTP methods in the same API endpoint)

      Steps to Reproduce

      1. Attempt to update description using the API.
        curl --location --request PUT 'https://site-name.atlassian.net/rest/api/3/fieldconfiguration/${id}/fields' \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data '{
            "fieldConfigurationItems": [
                {
                    "id": "customfield_12345",
                    "description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt",
                    "isHidden": false,
                    "isRequired": false
                }
            ]
        }'
        

        We'll see an error message like this.

        {
            "errorMessages": [
                "The length of the description for the item with ID customfield_10102 must not exceed 1,000 characters."
            ],
            "errors": {}
        }
        
      1. Attempt to udpate the description using UI [which updates using /secure/admin/EditFieldLayoutItem!default.jspa] with the same description above [1100 characters]
      2. the update will be successful
      3. Get the field fieldconfiguration using REST API (this will also be successful and will return the full description 1100 characters)
        curl --location 'https://site-name.atlassian.net/rest/api/3/fieldconfiguration/$id/fields' \
        --header 'Accept: application/json' \
        

      Expected Results

      The update PUT API endpoint should behave similarly to the UI and GET endpoint - no character limits.
      Or, the UI and GET method should have character limits of 1000 characters to align with the update endpoint.

      Actual Results

      update PUT endpoint is limiting description to 1000 characters; whereas, UI and GET endpoint is not enforcing any limits.

      Workaround

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

            [JRACLOUD-82640] Update field configuration API endpoint limits description to 1000 characters but the UI doesn't

            There are no comments yet on this issue.

              Unassigned Unassigned
              2ed764d1efd7 Nashid Farhad
              Affected customers:
              4 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated: