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

fixes #651: adds custom_status_id to Request object #652

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/org/zendesk/client/v2/model/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Request implements Serializable {
protected String subject;
protected String description;
protected Status status;
protected Long customStatusId;
protected Ticket.Requester requester;
protected Long requesterId;
protected Long organizationId;
Expand Down Expand Up @@ -87,6 +88,15 @@ public void setStatus(Status status) {
this.status = status;
}

@JsonProperty("custom_status_id")
public Long getCustomStatusId() {
return customStatusId;
}

public void setCustomStatusId(Long customStatusId) {
this.customStatusId = customStatusId;
}

public String getSubject() {
return subject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ private TicketResult parseJson(byte[] json) {

@Test
public void testParseTicketResult() {
String json = "{ \"ticket\": { \"id\": 21337631753}}";
String json = "{ \"ticket\": { \"id\": 21337631753, \"custom_status_id\": 9999}}";
TicketResult ev = parseJson(json.getBytes());
assertNotNull(ev);
assertEquals(Long.valueOf(9999), ev.getTicket().getCustomStatusId());
assertEquals(TicketResult.class, ev.getClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private Ticket createSampleTicket() {
ticket.setId(Math.abs(RANDOM.nextLong()));
ticket.setComment(new Comment(TICKET_COMMENT1));
ticket.setUpdatedAt(NOW);
ticket.setCustomStatusId(Math.abs(RANDOM.nextLong()));
return ticket;
}
}