From 73627a21bc94d6c37adaa36ef3ab0475a05a46f3 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sun, 19 Jun 2016 20:27:41 +0200 Subject: Add support for project-issue move --- gitlab/objects.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gitlab/objects.py') diff --git a/gitlab/objects.py b/gitlab/objects.py index bdadd38..8638b13 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1095,6 +1095,21 @@ class ProjectIssue(GitlabObject): raise_error_from_response(r, GitlabUnsubscribeError) self._set_from_dict(r.json()) + def move(self, to_project_id, **kwargs): + """Move the issue to another project. + + Raises: + GitlabConnectionError: If the server cannot be reached. + """ + url = ('/projects/%(project_id)s/issues/%(issue_id)s/move' % + {'project_id': self.project_id, 'issue_id': self.id}) + + data = {'to_project_id': to_project_id} + data.update(**kwargs) + r = self.gitlab._raw_post(url, data=data) + raise_error_from_response(r, GitlabUpdateError, 201) + self._set_from_dict(r.json()) + class ProjectIssueManager(BaseManager): obj_cls = ProjectIssue -- cgit v1.2.1