Closed diendanyoi54 closed 3 months ago
@diendanyoi54 sorry for the delay...
I don't have access to the Talk Partner Edition to check about the specifics, so I simply added the missing field value in the enum (https://github.com/cloudbees-oss/zendesk-java-client/pull/702). That would fix the issue you reported BUT I have no way to check if this is enough. Can you please test and report?
@PierreBtz it looks good to me but I'm not sure how you would like me to test prior to something being deployed.
You could build #702 and depend on it in your downstream project.
@PierreBtz I think you're missing TpeVoiceComment from the JsonSubTypes in the Comment class (and comment extension). I added that and tested locally and it worked!
@JsonSubTypes({@Type(
value = Comment.class,
name = "Comment"
), @Type(
value = VoiceComment.class,
name = "VoiceComment"
)})
public class Comment implements Serializable {
I created a PR against your branch just to show what else I added with no expectation of you merging it with your's. However, I did verify the code in my PR worked 😄 .
@diendanyoi54 thanks, I commented on the PR? I believe we can amend this one with:
@JsonTypeInfo(use = NAME, include = EXTERNAL_PROPERTY, property = "type", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = Comment.class, name = "Comment"),
@JsonSubTypes.Type(value = VoiceComment.class, name = "VoiceComment"),
@JsonSubTypes.Type(value = VoiceComment.class, name = "TpeVoiceComment")
})
public class Comment implements Serializable {
I recently attempted to upgrade our Java client from 0.13.0 to 0.25.0 because of the Cursor-based pagination update on May 20, 2024 but after making the switch, errors occurred when getTicketComments was called. We have comments that implement Talk Partner Edition which saves the comment type as TpeVoiceComment but the Comment object's type field of CommentType only has VoiceComment and Comment available so when deserializing the comment it throws an error.
Steps to reproduce the behavior:
When Cloudbees getTicketComments method is called, the expectation is that it will be able to properly deserialize TpeVoiceComment so it will not throw an error and instead properly return the comment.