Method: Gitlab::Client::Milestones#create_milestone

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

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

Creates a new milestone.

Examples:

Gitlab.create_milestone(5, 'v1.0')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • title (String)

    The title of a milestone.

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

    A customizable set of options.

Options Hash (options):

  • :description (String)

    The description of a milestone.

  • :due_date (String)

    The due date of a milestone.

Returns:


72
73
74
75
# File 'lib/gitlab/client/milestones.rb', line 72

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