Ejemplo n.º 1
0
    def create_issue(
        self,
        title: str,
        body: str,
        private: Optional[bool] = None,
        labels: Optional[List[str]] = None,
        assignees: Optional[List[str]] = None,
    ) -> Issue:

        ids = []
        for user in assignees or []:
            users_list = self.service.gitlab_instance.users.list(username=user)

            if not users_list:
                raise GitlabAPIException(f"Unable to find '{user}' username")

            ids.append(str(users_list[0].id))

        return GitlabIssue.create(
            project=self,
            title=title,
            body=body,
            private=private,
            labels=labels,
            assignees=ids,
        )
Ejemplo n.º 2
0
 def get_issue_list(
     self,
     status: IssueStatus = IssueStatus.open,
     author: Optional[str] = None,
     assignee: Optional[str] = None,
 ) -> List[Issue]:
     return GitlabIssue.get_list(
         project=self, status=status, author=author, assignee=assignee
     )
Ejemplo n.º 3
0
 def create_issue(
     self,
     title: str,
     body: str,
     private: Optional[bool] = None,
     labels: Optional[List[str]] = None,
 ) -> Issue:
     return GitlabIssue.create(
         project=self, title=title, body=body, private=private, labels=labels
     )
Ejemplo n.º 4
0
 def create_issue(self, title: str, description: str) -> Issue:
     return GitlabIssue.create(project=self, title=title, body=description)
Ejemplo n.º 5
0
 def get_issue(self, issue_id: int) -> Issue:
     return GitlabIssue.get(project=self, id=issue_id)
Ejemplo n.º 6
0
 def get_issue_list(self, status: IssueStatus = IssueStatus.open) -> List[Issue]:
     return GitlabIssue.get_list(project=self, status=status)