Method: Gitlab::Client::Issues#create_issue

Defined in:
lib/gitlab/client/issues.rb

#create_issue(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash

Creates a new issue.

Examples:

Gitlab.create_issue(5, 'New issue')
Gitlab.create_issue(5, 'New issue', { description: 'This is a new issue', assignee_id: 42 })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • title (String)

    The title of an issue.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :description (String)

    The description of an issue.

  • :assignee_id (Integer)

    The ID of a user to assign issue.

  • :milestone_id (Integer)

    The ID of a milestone to assign issue.

  • :labels (String)

    Comma-separated label names for an issue.

Returns:


54
55
56
57
# File 'lib/gitlab/client/issues.rb', line 54

def create_issue(project, title, options = {})
  body = { title: title }.merge(options)
  post("/projects/#{url_encode project}/issues", body: body)
end