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

Updating screen scheme via API (PUT /rest/api/3/screenscheme/{screenSchemeId}) is throwing inconsistent validation errors

XMLWordPrintable

      Issue Summary

      When using the Update Screen Scheme API (PUT /rest/api/3/screenscheme/{screenSchemeId}) to modify the name or description of a Screen Scheme, it is throwing inconsistent validation errors that contradict the API documentation.

      https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-screenschemeid-put

      Steps to Reproduce

      Attempt to update the Screen Scheme name or description via the Update Screen Scheme API.

      If only the name or description is provided in the request body:

      curl --request PUT \
        --url 'https://your-domain.atlassian.net/rest/api/3/screenscheme/{screenSchemeId}' \
        --user 'email@example.com:<api_token>' \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data '{
        "name": "Employee screen scheme v2"
      }' 

      An error is received stating:

      "The ID of the default screen has to be provided."

      If only the description is provided in the request body:

      Errors are received stating:

      "The screen scheme name has to be provided."

      "The ID of the default screen has to be provided."

      Expected Results

      The API should successfully update the Screen Scheme name or description when provided with the screenSchemeId, as stated in the documentation.

      The documentation specifies that the only required field is screenSchemeId.

      Actual Results

      If only the name or description is provided in the request body as per documentation

      Error: "The ID of the default screen has to be provided."

      Additional error when only the description is provided:

      "The screen scheme name has to be provided."

      "The ID of the default screen has to be provided."

      Workaround

      To bypass the validation errors and successfully update the Screen Scheme, include both the name and the IDs of the screens (including the default screen) in the request body. The request payload should look like this:

      curl --request PUT \
        --url 'https://your-domain.atlassian.net/rest/api/3/screenscheme/{screenSchemeId}' \
        --user 'email@example.com:<api_token>' \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data '{
        "name": "Employee screen scheme v2",
        "screens": {
          "create": "10019",
          "default": "10018"
        }
      }'

              686b465b8226 James Petty
              26a024868f5f Sherica Ocbania
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: