File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -891,6 +891,19 @@ class ProjectMilestone(GitlabObject):
891
891
optionalCreateAttrs = ['description' , 'due_date' , 'state_event' ]
892
892
shortPrintAttr = 'title'
893
893
894
+ def issues (self ):
895
+ url = "/projects/%s/milestones/%s/issues" % (self .project_id , self .id )
896
+ r = self .gitlab ._raw_get (url )
897
+ raise_error_from_response (r , GitlabDeleteError )
898
+
899
+ l = []
900
+ for j in r .json ():
901
+ o = ProjectIssue (self , j )
902
+ o ._from_api = True
903
+ l .append (o )
904
+
905
+ return l
906
+
894
907
895
908
class ProjectMilestoneManager (BaseManager ):
896
909
obj_cls = ProjectMilestone
Original file line number Diff line number Diff line change 131
131
m1 .save ()
132
132
m1 = admin_project .milestones .get (1 )
133
133
assert (m1 .state == 'closed' )
134
+
135
+ # issues
136
+ issue1 = admin_project .issues .create ({'title' : 'my issue 1' ,
137
+ 'milestone_id' : m1 .id })
138
+ issue2 = admin_project .issues .create ({'title' : 'my issue 2' })
139
+ issue3 = admin_project .issues .create ({'title' : 'my issue 3' })
140
+ assert (len (admin_project .issues .list ()) == 3 )
141
+ issue3 .state_event = 'close'
142
+ issue3 .save ()
143
+ assert (len (admin_project .issues .list (state = 'closed' )) == 1 )
144
+ assert (len (admin_project .issues .list (state = 'opened' )) == 2 )
145
+ assert (len (admin_project .issues .list (milestone = 'milestone1' )) == 1 )
146
+ assert (m1 .issues ()[0 ].title == 'my issue 1' )
You can’t perform that action at this time.
0 commit comments