From db1fb89d70feee8ef45876ec8ac5f9ccf69457a5 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 23 Jan 2016 19:44:12 +0100 Subject: Implement ProjectMilestone.issues() This lists the issues related to the milestone. Add python API tests for issues. --- gitlab/objects.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gitlab/objects.py') diff --git a/gitlab/objects.py b/gitlab/objects.py index 5ae1fb3..70c1286 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -891,6 +891,19 @@ class ProjectMilestone(GitlabObject): optionalCreateAttrs = ['description', 'due_date', 'state_event'] shortPrintAttr = 'title' + def issues(self): + url = "/projects/%s/milestones/%s/issues" % (self.project_id, self.id) + r = self.gitlab._raw_get(url) + raise_error_from_response(r, GitlabDeleteError) + + l = [] + for j in r.json(): + o = ProjectIssue(self, j) + o._from_api = True + l.append(o) + + return l + class ProjectMilestoneManager(BaseManager): obj_cls = ProjectMilestone -- cgit v1.2.1