From 930abe61893b21fa5aa3f060f1e793f6712adbed Mon Sep 17 00:00:00 2001 From: Kristopher Wilson Date: Thu, 22 Aug 2013 14:05:57 -0400 Subject: [PATCH] Implementing handling organization issues --- lib/Github/Api/Issue.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Github/Api/Issue.php b/lib/Github/Api/Issue.php index 56aa327ed47..c1afaf45ec5 100644 --- a/lib/Github/Api/Issue.php +++ b/lib/Github/Api/Issue.php @@ -51,6 +51,24 @@ public function find($username, $repository, $state, $keyword) return $this->get('legacy/issues/search/'.urlencode($username).'/'.urlencode($repository).'/'.urlencode($state).'/'.urlencode($keyword)); } + /** + * List issues by organization + * @link http://developer.github.com/v3/issues/ + * + * @param string $organization the organization + * @param string $state the issue state, can be open or closed + * @param array $params the additional parameters like milestone, assignees, labels, sort, direction + * @return array list of issues found + */ + public function org($organization, $state, array $params = array()) + { + if (!in_array($state, array('open', 'closed'))) { + $state = 'open'; + } + + return $this->get('orgs/'.urlencode($organization).'/issues', array_merge(array('page' => 1, 'state' => $state), $params)); + } + /** * Get extended information about an issue by its username, repo and number * @link http://developer.github.com/v3/issues/