From 8873edaeebd18d6b2ed08a8609c011ad29249b48 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 9 Jun 2018 18:08:38 +0200 Subject: Add support for issue links (EE) Fixes #422 --- docs/gl_objects/geo_nodes.rst | 2 +- docs/gl_objects/issues.rst | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/gl_objects/geo_nodes.rst b/docs/gl_objects/geo_nodes.rst index 44ed391..181ec91 100644 --- a/docs/gl_objects/geo_nodes.rst +++ b/docs/gl_objects/geo_nodes.rst @@ -11,7 +11,7 @@ Reference + :class:`gitlab.v4.objects.GeoNodeManager` + :attr:`gitlab.Gitlab.geonodes` -* GitLab API: https://docs.gitlab.com/ee/api/geo_nodes.html +* GitLab API: https://docs.gitlab.com/ee/api/geo_nodes.html (EE feature) Examples -------- diff --git a/docs/gl_objects/issues.rst b/docs/gl_objects/issues.rst index 0a6b254..7abaa78 100644 --- a/docs/gl_objects/issues.rst +++ b/docs/gl_objects/issues.rst @@ -159,3 +159,41 @@ Get the list of merge requests that will close an issue when merged:: Get the list of participants:: users = issue.participants() + +Issue links +=========== + +Reference +--------- + +* v4 API: + + + :class:`gitlab.v4.objects.ProjectIssueLink` + + :class:`gitlab.v4.objects.ProjectIssueLinkManager` + + :attr:`gitlab.v4.objects.ProjectIssue.links` + +* GitLab API: https://docs.gitlab.com/ee/api/issue_links.html (EE feature) + +Examples +-------- + +List the issues linked to ``i1``:: + + links = i1.links.list() + +Link issue ``i1`` to issue ``i2``:: + + data = { + 'target_project_id': i2.project_id, + 'target_issue_iid': i2.iid + } + src_issue, dest_issue = i1.links.create(data) + +.. note:: + + The ``create()`` method returns the source and destination ``ProjectIssue`` + objects, not a ``ProjectIssueLink`` object. + +Delete a link:: + + i1.links.delete(issue_link_id) -- cgit v1.2.1