Skip to content

Commit d3371c1

Browse files
committed
Added createComment() method to append a new comment to an existing ticket
1 parent 55d4375 commit d3371c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/zendesk/client/v2/Zendesk.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,14 @@ public Comment getRequestComment(long requestId, long commentId) {
611611
handle(Comment.class, "comment")));
612612
}
613613

614+
public Ticket createComment(long ticketId, Comment comment) {
615+
Ticket ticket = new Ticket();
616+
ticket.setComment(comment);
617+
return complete(submit(req("PUT", tmpl("/tickets/{id}.json").set("id", ticketId), JSON,
618+
json(Collections.singletonMap("ticket", ticket))),
619+
handle(Ticket.class, "ticket")));
620+
}
621+
614622
public Iterable<Organization> getOrganizations() {
615623
return new PagedIterable<Organization>(cnst("/organizations.json"),
616624
handleList(Organization.class, "organizations"));

0 commit comments

Comments
 (0)