@@ -1539,6 +1539,43 @@ class ProjectIssueDiscussionManager(RetrieveMixin, CreateMixin, RESTManager):
15391539 _create_attrs = (('body' ,), ('created_at' ,))
15401540
15411541
1542+ class ProjectIssueLink (ObjectDeleteMixin , RESTObject ):
1543+ _id_attr = 'issue_link_id'
1544+
1545+
1546+ class ProjectIssueLinkManager (ListMixin , CreateMixin , DeleteMixin ,
1547+ RESTManager ):
1548+ _path = '/projects/%(project_id)s/issues/%(issue_iid)s/links'
1549+ _obj_cls = ProjectIssueLink
1550+ _from_parent_attrs = {'project_id' : 'project_id' , 'issue_iid' : 'iid' }
1551+ _create_attrs = (('target_project_id' , 'target_issue_iid' ), tuple ())
1552+
1553+ @exc .on_http_error (exc .GitlabCreateError )
1554+ def create (self , data , ** kwargs ):
1555+ """Create a new object.
1556+
1557+ Args:
1558+ data (dict): parameters to send to the server to create the
1559+ resource
1560+ **kwargs: Extra options to send to the Gitlab server (e.g. sudo)
1561+
1562+ Returns:
1563+ RESTObject, RESTObject: The source and target issues
1564+
1565+ Raises:
1566+ GitlabAuthenticationError: If authentication is not correct
1567+ GitlabCreateError: If the server cannot perform the request
1568+ """
1569+ self ._check_missing_create_attrs (data )
1570+ server_data = self .gitlab .http_post (self .path , post_data = data ,
1571+ ** kwargs )
1572+ source_issue = ProjectIssue (self ._parent .manager ,
1573+ server_data ['source_issue' ])
1574+ target_issue = ProjectIssue (self ._parent .manager ,
1575+ server_data ['target_issue' ])
1576+ return source_issue , target_issue
1577+
1578+
15421579class ProjectIssue (UserAgentDetailMixin , SubscribableMixin , TodoMixin ,
15431580 TimeTrackingMixin , ParticipantsMixin , SaveMixin ,
15441581 ObjectDeleteMixin , RESTObject ):
@@ -1547,6 +1584,7 @@ class ProjectIssue(UserAgentDetailMixin, SubscribableMixin, TodoMixin,
15471584 _managers = (
15481585 ('awardemojis' , 'ProjectIssueAwardEmojiManager' ),
15491586 ('discussions' , 'ProjectIssueDiscussionManager' ),
1587+ ('links' , 'ProjectIssueLinkManager' ),
15501588 ('notes' , 'ProjectIssueNoteManager' ),
15511589 )
15521590
0 commit comments