Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
2ced002f
Commit
2ced002f
authored
Nov 03, 2015
by
Tim Olshansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #83 from wikiwi/update-mr
Add Method to Update Merge Request
parents
e69652bb
d18c394e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+30
-0
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
2ced002f
...
...
@@ -645,6 +645,36 @@ public class GitlabAPI {
return
retrieve
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
}
/**
* Updates a Merge Request
*
* @param projectId The id of the project
* @param mergeRequestId The id of the merge request to update
* @param targetBranch The target branch of the merge request, otherwise null to leave it untouched
* @param assigneeId The id of the assignee, otherwise null to leave it untouched
* @param title The title of the merge request, otherwise null to leave it untouched
* @param description The description of the merge request, otherwise null to leave it untouched
* @param stateEvent The state (close|reopen|merge) of the merge request, otherwise null to leave it untouched
* @param labels A comma separated list of labels, otherwise null to leave it untouched
* @return the Merge Request
* @throws IOException on gitlab api call error
*/
public
GitlabMergeRequest
updateMergeRequest
(
Serializable
projectId
,
Integer
mergeRequestId
,
String
targetBranch
,
Integer
assigneeId
,
String
title
,
String
description
,
String
stateEvent
,
String
labels
)
throws
IOException
{
Query
query
=
new
Query
()
.
appendIf
(
"target_branch"
,
targetBranch
)
.
appendIf
(
"assignee_id"
,
assigneeId
)
.
appendIf
(
"title"
,
title
)
.
appendIf
(
"description"
,
description
)
.
appendIf
(
"state_event"
,
stateEvent
)
.
appendIf
(
"labels"
,
labels
);
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
projectId
)
+
"/merge_request/"
+
mergeRequestId
+
query
.
toString
();
return
retrieve
().
method
(
"PUT"
).
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
}
/**
* @param project The Project
* @param mergeRequestId Merge Request ID
...
...
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