public static Issue getIssue(GitHubEvent event) {
        if (event == null || event.payload() == null) {
            return null;
        }

        switch (event.type()) {
            case IssuesEvent:
                return ((IssuesPayload) event.payload()).issue();
            case IssueCommentEvent:
                return ((IssueCommentPayload) event.payload()).issue();
            case PullRequestEvent:
                return toIssue(((PullRequestPayload) event.payload()).pullRequest());
            default:
                return null;
        }
    }
Get issue from event

@param event
@return issue or null if event doesn't apply
app/src/main/java/com/github/pockethub/android/core/issue/IssueEventMatcher.java