Skip to content

Commit

Permalink
Merge pull request #652 from timveil-startree/master
Browse files Browse the repository at this point in the history
fixes #651: adds `custom_status_id` to `Request` object
  • Loading branch information
PierreBtz committed Jan 19, 2024
2 parents 6a94776 + 68b04ca commit 2ff8704
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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());
}
}
1 change: 1 addition & 0 deletions src/test/java/org/zendesk/client/v2/model/TicketTest.java
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;
}
}

0 comments on commit 2ff8704

Please sign in to comment.