Module: Gitlab::Client::Boards

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/boards.rb

Overview

Defines methods related to issue boards.

Instance Method Summary collapse

Instance Method Details

#board_list(project, board_id, id) ⇒ Gitlab::ObjectifiedHash

Gets a single board list

Examples:

Gitlab.board_list(5, 42, 25)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • board_id (Integer)

    The ID of a board.

  • id (Integer)

    The ID of a list.

Returns:



44
45
46
# File 'lib/gitlab/client/boards.rb', line 44

def board_list(project, board_id, id)
  get("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
end

#board_lists(project, id) ⇒ Gitlab::ObjectifiedHash

Gets a board lists

Examples:

Gitlab.board_lists(5, 42)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a board.

Returns:



30
31
32
# File 'lib/gitlab/client/boards.rb', line 30

def board_lists(project, id)
  get("/projects/#{url_encode project}/boards/#{id}/lists")
end

#boards(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of project’s boards.

Examples:

Gitlab.boards(5)
Gitlab.boards({ per_page: 40 })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

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

    A customizable set of options.

Options Hash (options):

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:



18
19
20
# File 'lib/gitlab/client/boards.rb', line 18

def boards(project, options = {})
  get("/projects/#{url_encode project}/boards", query: options)
end

#create_board_list(project, board_id, label_id) ⇒ Gitlab::ObjectifiedHash

Creates a new board list. Only for admins and project owners

Examples:

Gitlab.create_board_list(5, 42, 25)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a board.

  • label_id (Integer)

    The ID of a label.

Returns:



58
59
60
# File 'lib/gitlab/client/boards.rb', line 58

def create_board_list(project, board_id, label_id)
  post("/projects/#{url_encode project}/boards/#{board_id}/lists", body: { label_id: label_id })
end

#delete_board_list(project, board_id, id) ⇒ Gitlab::ObjectifiedHash

Deletes a board list. Only for admins and project owners

Examples:

Gitlab.delete_board_list(3, 42, 32)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • board_id (Integer)

    The ID of a board.

  • id (Integer)

    The ID of a list.

Returns:



86
87
88
# File 'lib/gitlab/client/boards.rb', line 86

def delete_board_list(project, board_id, id)
  delete("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
end

#edit_board_list(project, board_id, id, position) ⇒ Gitlab::ObjectifiedHash

Updates a board list. Only for admins and project owners

Examples:

Gitlab.edit_board_list(6, 1, 12, 5)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • board_id (Integer)

    The ID of a board.

  • id (Integer)

    The ID of a list.

Returns:



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

def edit_board_list(project, board_id, id, position)
  put("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}", body: { position: position })
end