Skip to content
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

Add Ticket properties to support safe update #630

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Add Ticket properties to support safe update #630

merged 3 commits into from
Nov 6, 2023

Conversation

btpnlsl
Copy link

@btpnlsl btpnlsl commented Oct 19, 2023

#629
This change adds the safe_update and updated_stamp properties to the Ticket class to support Zendesk's protection against ticket update collisions as described in the Zendesk documentation.

These properties will only serialize into JSON when safe_update is set to TRUE.

I've added some unit tests for serialization and have performed some manual tests to validate:

  • Attempting to update a ticket with safe_update set to true can succeed.
  • Attempting to update an out-of-date ticket with safe_update set to true will result in a HTTP CONFLICT status.
  • Attempting to update an out-of-date ticket with safe_update set to false will succeed.

PierreBtz
PierreBtz previously approved these changes Nov 6, 2023
Copy link
Collaborator

@PierreBtz PierreBtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the contribution. I'll merge once CI is green.

src/main/java/org/zendesk/client/v2/model/Ticket.java Outdated Show resolved Hide resolved
@PierreBtz PierreBtz merged commit 352bb48 into cloudbees-oss:master Nov 6, 2023
3 checks passed
@btpnlsl btpnlsl deleted the safe_update branch November 6, 2023 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants