-
-
Notifications
You must be signed in to change notification settings - Fork 892
Fix partial update for sprint should use POST #1920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Partial updates should use POST instead of PUT: https://docs.atlassian.com/jira-software/REST/9.17.0/#agile/1.0/sprint-partiallyUpdateSprint
did you encounter issues? just wonderingas our tests dont really show failures with putting |
@studioj , yes, with PUT Jira Data Center is expecting you to define all the fields. Instead, with POST I can only define the fields that I intend to change |
@marcotollini can you then add a test so that the two behaviors become apparent? Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As documented here, POST
is correct for a partially updated Sprint, where if the value is not set then the fields are not updated.
If someone wanted to unset the value it would be interesting. Perhaps, we can add a additional argument called partial
which is default False
(to preserve original behaviour), but can be set to True
to do the true partial
update.
@@ -5391,7 +5391,7 @@ def update_sprint( | |||
payload["goal"] = goal | |||
|
|||
url = self._get_url(f"sprint/{id}", base=self.AGILE_BASE_URL) | |||
r = self._session.put(url, data=json.dumps(payload)) | |||
r = self._session.post(url, data=json.dumps(payload)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r = self._session.post(url, data=json.dumps(payload)) | |
method = self._session.post if partial else self._session.put | |
r = method(url, data=json.dumps(payload)) |
(with corresponding addition of partial
to args
Partial updates should use POST instead of PUT:
https://docs.atlassian.com/jira-software/REST/9.17.0/#agile/1.0/sprint-partiallyUpdateSprint