Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
40ef18a7
Commit
40ef18a7
authored
Apr 04, 2018
by
Johan Brandhorst
Committed by
Sander van Harmelen
Apr 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for getting project milestone merge requests. (#368)
Fixes #366.
parent
109fd962
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
milestones.go
milestones.go
+33
-0
No files found.
milestones.go
View file @
40ef18a7
...
...
@@ -212,3 +212,36 @@ func (s *MilestonesService) GetMilestoneIssues(pid interface{}, milestone int, o
return
i
,
resp
,
err
}
// GetMilestoneMergeRequestsOptions represents the available
// GetMilestoneMergeRequests() options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#get-all-merge-requests-assigned-to-a-single-milestone
type
GetMilestoneMergeRequestsOptions
ListOptions
// GetMilestoneMergeRequests gets all merge requests assigned to a single
// project milestone.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/milestones.html#get-all-merge-requests-assigned-to-a-single-milestone
func
(
s
*
MilestonesService
)
GetMilestoneMergeRequests
(
pid
interface
{},
milestone
int
,
opt
*
GetMilestoneMergeRequestsOptions
,
options
...
OptionFunc
)
([]
*
MergeRequest
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/milestones/%d/merge_requests"
,
url
.
QueryEscape
(
project
),
milestone
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
var
mr
[]
*
MergeRequest
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
mr
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
mr
,
resp
,
err
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment