4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

特定のマイルストーンのIssueの一覧を取得する

Last updated at Posted at 2014-12-24

GitHubでマイルストーンに紐付いているIssueの一覧を取得する方法。
Octokit.rbを使用した場合の例。

  • GitHub API: v3

手順

  • マイルストーン名からマイルストーンの番号を取得
  • マイルストーンの番号をつかってらissue一覧を絞りこみする

コード例

require 'octokit'

def issues_filter_milestone(repo, name)
  number = Octokit.list_milestones(repo).select do |milestone|
    milestone.title == name
  end.first.number
  Octokit.list_issues(repo, milestone: number)
end

issues_filter_milestone("great-h/great-h.github.io","20141224")

レスポンスの例はGitHubのAPIのドキュメントを見てください。

list_issuesはstatusがopenのissueのみを取得します。status: 'all'を付加するとcolsedなissueも取得できます。

Octokit.list_issues(repo, milestone: number)

参考文献

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?