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
371f99da
Unverified
Commit
371f99da
authored
Jun 11, 2018
by
Sander van Harmelen
Committed by
GitHub
Jun 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support endpoint to collect merge requests closing an issue (#421)
parent
73e9df58
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
issues.go
issues.go
+33
-0
merge_requests.go
merge_requests.go
+2
-2
No files found.
issues.go
View file @
371f99da
...
...
@@ -362,6 +362,39 @@ func (s *IssuesService) DeleteIssue(pid interface{}, issue int, options ...Optio
return
s
.
client
.
Do
(
req
,
nil
)
}
// ListMergeRequestsClosingIssueOptions represents the available
// ListMergeRequestsClosingIssue() options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#list-merge-requests-that-will-close-issue-on-merge
type
ListMergeRequestsClosingIssueOptions
ListOptions
// ListMergeRequestsClosingIssue gets all the merge requests that will close
// issue when merged.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/issues.html#list-merge-requests-that-will-close-issue-on-merge
func
(
s
*
IssuesService
)
ListMergeRequestsClosingIssue
(
pid
interface
{},
issue
int
,
opt
*
ListMergeRequestsClosingIssueOptions
,
options
...
OptionFunc
)
([]
*
MergeRequest
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"/projects/%s/issues/%d/closed_by"
,
url
.
QueryEscape
(
project
),
issue
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
var
m
[]
*
MergeRequest
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
m
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
m
,
resp
,
err
}
// SetTimeEstimate sets the time estimate for a single project issue.
//
// GitLab API docs:
...
...
merge_requests.go
View file @
371f99da
...
...
@@ -348,7 +348,7 @@ func (s *MergeRequestsService) ListMergeRequestPipelines(pid interface{}, mergeR
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/merge_requests/%
v
/pipelines"
,
url
.
QueryEscape
(
project
),
mergeRequest
)
u
:=
fmt
.
Sprintf
(
"projects/%s/merge_requests/%
d
/pipelines"
,
url
.
QueryEscape
(
project
),
mergeRequest
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
if
err
!=
nil
{
...
...
@@ -381,7 +381,7 @@ func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid interface{}, mergeRequ
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"/projects/%s/merge_requests/%
v
/closes_issues"
,
url
.
QueryEscape
(
project
),
mergeRequest
)
u
:=
fmt
.
Sprintf
(
"/projects/%s/merge_requests/%
d
/closes_issues"
,
url
.
QueryEscape
(
project
),
mergeRequest
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
...
...
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