added support for the issue comments

This commit is contained in:
Kohsuke Kawaguchi
2011-06-24 17:56:51 -07:00
parent 561f8397ee
commit bb3bfe4be8
3 changed files with 102 additions and 0 deletions

View File

@@ -116,6 +116,13 @@ public class GHIssue {
new Poster(root).withCredential().to(getApiRoute("reopen"));
}
/**
* Obtains all the comments associated with this issue.
*/
public List<GHIssueComment> getComments() throws IOException {
return root.retrieve(getApiRoute("comments"), JsonIssueComments.class).wrap(this);
}
private String getApiRoute(String verb) {
return "/issues/"+verb+"/"+owner.getOwnerName()+"/"+owner.getName()+"/"+number;
}