| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 261f947 commit 580f21e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,16 @@ | |||
| 8 | 8 | tagged_issues = gl.issues.list(labels=['foo', 'bar']) | |
| 9 | 9 | # end filtered list | |
| 10 | 10 | ||
| 11 | + # group issues list | ||
| 12 | + issues = gl.group_issues.list(group_id=1) | ||
| 13 | + # or | ||
| 14 | + issues = group.issues.list() | ||
| 15 | + # Filter using the state, labels and milestone parameters | ||
| 16 | + issues = group.issues.list(milestone='1.0', state='opened') | ||
| 17 | + # Order using the order_by and sort parameters | ||
| 18 | + issues = group.issues.list(order_by='created_at', sort='desc') | ||
| 19 | + # end group issues list | ||
| 20 | + | ||
| 11 | 21 | # project issues list | |
| 12 | 22 | issues = gl.project_issues.list(project_id=1) | |
| 13 | 23 | # or | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,22 @@ Use the ``state`` and ``label`` parameters to filter the results. Use the | |||
| 25 | 25 | :start-after: # filtered list | |
| 26 | 26 | :end-before: # end filtered list | |
| 27 | 27 | ||
| 28 | + Group issues | ||
| 29 | + ============ | ||
| 30 | + | ||
| 31 | + Use :class:`~gitlab.objects.GroupIssue` objects to manipulate issues. The | ||
| 32 | + :attr:`gitlab.Gitlab.project_issues` and :attr:`Group.issues | ||
| 33 | + <gitlab.objects.Group.issues>` manager objects provide helper functions. | ||
| 34 | + | ||
| 35 | + Examples | ||
| 36 | + -------- | ||
| 37 | + | ||
| 38 | + List the group issues: | ||
| 39 | + | ||
| 40 | + .. literalinclude:: issues.py | ||
| 41 | + :start-after: # group issues list | ||
| 42 | + :end-before: # end group issues list | ||
| 43 | + | ||
| 28 | 44 | Project issues | |
| 29 | 45 | ============== | |
| 30 | 46 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,6 +68,7 @@ class Gitlab(object): | |||
| 68 | 68 | user_emails (UserEmailManager): Manager for GitLab users' emails. | |
| 69 | 69 | user_keys (UserKeyManager): Manager for GitLab users' SSH keys. | |
| 70 | 70 | users (UserManager): Manager for GitLab users | |
| 71 | + group_issues (GroupIssueManager): Manager for GitLab group issues | ||
| 71 | 72 | group_projects (GroupProjectManager): Manager for GitLab group projects | |
| 72 | 73 | group_members (GroupMemberManager): Manager for GitLab group members | |
| 73 | 74 | groups (GroupManager): Manager for GitLab members | |
@@ -148,6 +149,7 @@ def __init__(self, url, private_token=None, email=None, password=None, | |||
| 148 | 149 | self.user_emails = UserEmailManager(self) | |
| 149 | 150 | self.user_keys = UserKeyManager(self) | |
| 150 | 151 | self.users = UserManager(self) | |
| 152 | + self.group_issues = GroupIssueManager(self) | ||
| 151 | 153 | self.group_projects = GroupProjectManager(self) | |
| 152 | 154 | self.group_members = GroupMemberManager(self) | |
| 153 | 155 | self.groups = GroupManager(self) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -679,6 +679,20 @@ class ApplicationSettingsManager(BaseManager): | |||
| 679 | 679 | obj_cls = ApplicationSettings | |
| 680 | 680 | ||
| 681 | 681 | ||
| 682 | + class GroupIssue(GitlabObject): | ||
| 683 | + _url = '/groups/%(group_id)s/issues' | ||
| 684 | + canGet = 'from_list' | ||
| 685 | + canCreate = False | ||
| 686 | + canUpdate = False | ||
| 687 | + canDelete = False | ||
| 688 | + requiredUrlAttrs = ['group_id'] | ||
| 689 | + optionalListAttrs = ['state', 'labels', 'milestone', 'order_by', 'sort'] | ||
| 690 | + | ||
| 691 | + | ||
| 692 | + class GroupIssueManager(BaseManager): | ||
| 693 | + obj_cls = GroupIssue | ||
| 694 | + | ||
| 695 | + | ||
| 682 | 696 | class GroupMember(GitlabObject): | |
| 683 | 697 | _url = '/groups/%(group_id)s/members' | |
| 684 | 698 | canGet = 'from_list' | |
@@ -718,7 +732,8 @@ class Group(GitlabObject): | |||
| 718 | 732 | optionalUpdateAttrs = ['name', 'path', 'description', 'visibility_level'] | |
| 719 | 733 | shortPrintAttr = 'name' | |
| 720 | 734 | managers = [('members', GroupMemberManager, [('group_id', 'id')]), | |
| 721 | - ('projects', GroupProjectManager, [('group_id', 'id')])] | ||
| 735 | + ('projects', GroupProjectManager, [('group_id', 'id')]), | ||
| 736 | + ('issues', GroupIssueManager, [('group_id', 'id')])] | ||
| 722 | 737 | ||
| 723 | 738 | GUEST_ACCESS = 10 | |
| 724 | 739 | REPORTER_ACCESS = 20 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments