Uploaded image for project: 'Jira Align'
  1. Jira Align
  2. JIRAALIGN-4403

REST API PATCH and PUT methods remove the values of fields that are not visible in the UI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 10.113.0
    • 10.110.3
    • REST API
    • 1
    • Severity 3 - Minor
    • No

    Description

      Issue Summary

      Trying to change the description of a feature using a PATCH or a PUT method, removes the values of fields that are not displayed in the UI (not enabled in the Details Panels Settings of a Portfolio or under the Plateform in the case of the Product with the Manage Product option).
      Even if you specify the values for the fields, they are ignored
      In the audit log you see the following:

      By Francois Panaget via API on 12/09/2022 09:53:25
      Feature was updated
      Description Changed - From [ FXP Baclog2 ] To [ FXP Baclog2 changed ]
      Product Changed - From [ FXPProductCH ] To [ ]
      Category Changed - From [ Innovation ] To [ ]

      Steps to Reproduce

      1. Make sure the option 'Manage Product' under Admin > Platform > Portfolio Specific configuration > "YourPortfolioName" is set to 'Yes' and/or the 'Category' field is enabled under Admin > Details Panels Settings > "YourPortfolioName" > Features
      2. Create a Feature where you set a product and a Category.
      3. Set the option under 'Manage Product' Admin > Platform > Portfolio Specific configuration > "YourPortfolioName" to be 'No' and/or disable the 'Category' field under Admin > Details Panels Settings > "YourPortfolioName" > Features
      4. Issue a PATCH or PUT REST API call to change the description of the feature.
        For example, using a PATCH with the body:
        [
            {
                "op": "replace",
                "path": "/description",
                "value": "FXP Baclog2 changed"
            }
        ]
        

        or with the existing value

        [
            {
                "op": "replace",
                "path": "/description",
                "value": "FXP Baclog2 changed"
            },
            {
                "op": "replace",
                "path": "/productId",
                "value": 66
            },
            {
                "op": "replace",
                "path": "/category",
                "value": 1
            }
        ]
        

      Expected Results

      As the value for the Category and Product was not changed (it is just hidden) it will not be changed and the Audit Log will not register any change.
      If you specify a value for these hidden fields, the value is taken into account (if equal to existing it is ignored and if different, the field is updated with the new value).

      Actual Results

      A change is registered on the Audit Logs and the value previously set for the product and category is wiped out/removed.
      If you specify a value (equal to existing or new) for these hidden fields, the value is ignored.

      Workaround

      To prevent this behavior make sure to make to make the field visible in the UI thru for example Admin > Platform > Portfolio Specific configuration > "YourPortfolioName" and/or the 'Category' field is enabled under Admin > Details Panels Settings > "YourPortfolioName" > Features.

      Attachments

        Issue Links

          Activity

            People

              csmith1@atlassian.com Cap Smith
              646db21d89d1 Francois Panaget
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync