diff --git a/src/main/java/org/kohsuke/github/GHIssue.java b/src/main/java/org/kohsuke/github/GHIssue.java index e2d5e39bdb..2f9686ae22 100644 --- a/src/main/java/org/kohsuke/github/GHIssue.java +++ b/src/main/java/org/kohsuke/github/GHIssue.java @@ -121,6 +121,9 @@ protected static List getLogins(Collection users) { /** The assignees. */ protected GHUser[] assignees; + /** The author's association with the repository. */ + protected String authorAssociation; + /** The body. */ @SkipFromToString protected String body; @@ -349,6 +352,17 @@ public List getAssignees() { return Collections.unmodifiableList(Arrays.asList(assignees)); } + /** + * Gets the author's association with the repository. + * + * @return the author association + */ + public GHCommentAuthorAssociation getAuthorAssociation() { + return EnumUtils.getEnumOrDefault(GHCommentAuthorAssociation.class, + authorAssociation, + GHCommentAuthorAssociation.UNKNOWN); + } + /** * The description of this pull request. * diff --git a/src/test/java/org/kohsuke/github/GHIssueTest.java b/src/test/java/org/kohsuke/github/GHIssueTest.java index 6fdaf379bc..19f2a2bd1b 100644 --- a/src/test/java/org/kohsuke/github/GHIssueTest.java +++ b/src/test/java/org/kohsuke/github/GHIssueTest.java @@ -169,6 +169,7 @@ public void createIssue() throws Exception { GHRepository repo = getRepository(); GHIssue issue = repo.createIssue(name).body("## test").create(); assertThat(issue.getTitle(), equalTo(name)); + assertThat(issue.getAuthorAssociation(), equalTo(GHCommentAuthorAssociation.NONE)); } /**