Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit73627a2

Browse files
author
Gauvain Pocentek
committed
Add support for project-issue move
1 parentca68f6d commit73627a2

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

‎gitlab/cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
'filepath']},
4545
'builds': {'required': ['id','project-id']}},
4646
gitlab.ProjectIssue: {'subscribe': {'required': ['id','project-id']},
47-
'unsubscribe': {'required': ['id','project-id']}},
47+
'unsubscribe': {'required': ['id','project-id']},
48+
'move': {'required': ['id','project-id',
49+
'to-project-id']}},
4850
gitlab.ProjectMergeRequest: {
4951
'closes-issues': {'required': ['id','project-id']},
5052
'cancel': {'required': ['id','project-id']},
@@ -280,6 +282,13 @@ def do_project_issue_unsubscribe(self, cls, gl, what, args):
280282
exceptExceptionase:
281283
_die("Impossible to subscribe to issue (%s)"%str(e))
282284

285+
defdo_project_issue_move(self,cls,gl,what,args):
286+
try:
287+
o=self.do_get(cls,gl,what,args)
288+
o.move(args['to_project_id'])
289+
exceptExceptionase:
290+
_die("Impossible to move issue (%s)"%str(e))
291+
283292
defdo_project_merge_request_closesissues(self,cls,gl,what,args):
284293
try:
285294
o=self.do_get(cls,gl,what,args)

‎gitlab/objects.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,21 @@ def unsubscribe(self, **kwargs):
10951095
raise_error_from_response(r,GitlabUnsubscribeError)
10961096
self._set_from_dict(r.json())
10971097

1098+
defmove(self,to_project_id,**kwargs):
1099+
"""Move the issue to another project.
1100+
1101+
Raises:
1102+
GitlabConnectionError: If the server cannot be reached.
1103+
"""
1104+
url= ('/projects/%(project_id)s/issues/%(issue_id)s/move'%
1105+
{'project_id':self.project_id,'issue_id':self.id})
1106+
1107+
data= {'to_project_id':to_project_id}
1108+
data.update(**kwargs)
1109+
r=self.gitlab._raw_post(url,data=data)
1110+
raise_error_from_response(r,GitlabUpdateError,201)
1111+
self._set_from_dict(r.json())
1112+
10981113

10991114
classProjectIssueManager(BaseManager):
11001115
obj_cls=ProjectIssue

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp