GitLab API | gitlab gem で 新規Issueの作成
概要
gitlab gem で 新規Issueの作成
シグネチャ
create_issue(project, title, options = {})
project は プロジェクトの id
title は Issue のタイトル文字列
option | type | 内容 |
---|---|---|
:description | String | Issueの内容。Markdownで記述 |
:assignee_id | Integer | アサイン先のid |
:milestone_id | Integer | マイルストーンのid |
:labels | String | カンマ区切りのラベル名のリスト |
サンプル
Issue の title 「api test」
Issue の description 「api test」
Issue の assignee_id 「4」
Issue の labels ruby と gitlab
で新規 Issue を作成します。
require 'gitlab'
Gitlab.configure do |config|
config.endpoint = 'http://some_path/api/v3'
config.private_token = 'your token'
end
puts Gitlab.issues.size # => この段階では 0
project_id = 31
issue_title = 'api test'
options = {
description: 'description',
assignee_id: 4,
labels: 'ruby,gitlab',
}
Gitlab.create_issue(project_id, issue_title, options)
puts Gitlab.issues.size # => この段階では 1
出力
0
1
参照
GitLab gem RubyGems
https://rubygems.org/gems/gitlabGitLab gem GitHub
https://github.com/NARKOZ/gitlab