Skip to content
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
13 changes: 13 additions & 0 deletions src/main/java/org/kohsuke/github/GHIssue.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ protected static List<String> getLogins(Collection<GHUser> users) {
/** The number. */
protected int number;

/** The GitHub App that opened the issue on behalf of a user. */
protected GHApp performedViaGithubApp;

/** The pull request. */
protected GHIssue.PullRequest pullRequest;

Expand Down Expand Up @@ -463,6 +466,16 @@ public int getNumber() {
return number;
}

/**
* Gets the GitHub App that opened this issue on behalf of a user.
*
* @return the GitHub App, or null if the issue was not opened through one
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHApp getPerformedViaGithubApp() {
return performedViaGithubApp;
}

/**
* Returns non-null if this issue is a shadow of a pull request.
*
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/kohsuke/github/GHEventPayloadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ public void issues() throws Exception {
assertThat(event.getIssue().getState(), is(GHIssueState.OPEN));
assertThat(event.getIssue().getLabels().size(), is(1));
assertThat(event.getIssue().getLabels().iterator().next().getName(), is("bug"));
assertThat(event.getIssue().getPerformedViaGithubApp().getSlug(), is("octoapp"));
assertThat(event.getRepository().getName(), is("public-repo"));
assertThat(event.getRepository().getOwner().getLogin(), is("baxterthehacker"));
assertThat(event.getSender().getLogin(), is("baxterthehacker"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
"created_at": "2015-05-05T23:40:28Z",
"updated_at": "2015-05-05T23:40:28Z",
"closed_at": null,
"performed_via_github_app": {
"id": 1,
"slug": "octoapp",
"name": "Octocat App"
},
"body": "It looks like you accidently spelled 'commit' with two 't's."
},
"repository": {
Expand Down
Loading