Module: Gitlab::Client::IssueLinks

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

Overview

Defines methods related to issue links.

Instance Method Summary collapse

Instance Method Details

Creates a new issue link.

Examples:

Gitlab.create_issue_link(6, 1, 6, 2)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • issue (Integer)

    The ID of an issue.

  • target_project_id (Integer)

    Project ID the target issue is located in.

  • target_issue_iid (Integer)

    The ID of the target issue.

Returns:



31
32
33
# File 'lib/gitlab/client/issue_links.rb', line 31

def create_issue_link(project, issue, target_project_id, target_issue_iid)
  post("/projects/#{url_encode project}/issues/#{issue}/links", body: { target_project_id: target_project_id, target_issue_iid: target_issue_iid })
end

Deletes an issue link.

Examples:

Gitlab.delete_issue_link(5, 10, 123)

Parameters:

  • project (Integer)

    The ID of a project.

  • issue (Integer)

    The ID of an issue.

  • id (Integer)

    The ID of a link.

Returns:



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

def delete_issue_link(project, issue, id)
  delete("/projects/#{url_encode project}/issues/#{issue}/links/#{id}")
end

Gets a list of links for a issue.

Examples:

Gitlab.issue_links(5, 10)

Parameters:

  • project (Integer)

    The ID of a project.

  • issue (Integer)

    The ID of an issue.

  • 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:



17
18
19
# File 'lib/gitlab/client/issue_links.rb', line 17

def issue_links(project, issue, options = {})
  get("/projects/#{url_encode project}/issues/#{issue}/links", query: options)
end