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:



41
42
43
# File 'lib/gitlab/client/boards.rb', line 41

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:



28
29
30
# File 'lib/gitlab/client/boards.rb', line 28

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:



16
17
18
# File 'lib/gitlab/client/boards.rb', line 16

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:



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

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:



83
84
85
# File 'lib/gitlab/client/boards.rb', line 83

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:



69
70
71
# File 'lib/gitlab/client/boards.rb', line 69

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