-
Bug
-
Resolution: Fixed
-
Medium
-
Severity 3 - Minor
-
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.
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" } }'