Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
203e968f
Commit
203e968f
authored
Nov 23, 2019
by
Greg Messner
Browse files
Added moveIssue() (#480).
parent
2a4e9eda
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/IssuesApi.java
View file @
203e968f
...
...
@@ -984,18 +984,25 @@ public class IssuesApi extends AbstractApi implements Constants {
}
/**
* Gets issues count statistics for given group.
* <p>Moves an issue to a different project. If the target project equals the source project or
* the user has insufficient permissions to move an issue, error 400 together with an
* explaining error message is returned.</p>
*
* <p>If a given label and/or milestone with the same name also exists in the target project,
* it will then be assigned to the issue that is being moved.</p>
*
* <pre><code>GitLab Endpoint:
GE
T /projects/:projectId/issues
_statistics
</code></pre>
* <pre><code>GitLab Endpoint:
POS
T /projects/:projectId/issues
/:issue_iid/move
</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param filter {@link IssuesStatisticsFilter} a IssuesStatisticsFilter instance with the filter settings.
* @return an IssuesStatistics instance with the statistics for the matched issues
* @param issueIid the IID of the issue to move
* @paream toProjectId the ID of the project to move the issue to
* @return an Issue instance for the moved issue
* @throws GitLabApiException if any exception occurs
*/
public
IssuesStatistics
geProjectIssuesStatistics
(
Object
projectIdOrPath
,
IssuesStatisticsFilter
filter
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
filter
.
getQueryParams
();
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
this
.
getProjectIdOrPath
(
projectIdOrPath
),
"issues_statistics"
);
return
(
response
.
readEntity
(
IssuesStatistics
.
class
));
}
public
Issue
moveIssue
(
Object
projectIdOrPath
,
Integer
issueIid
,
Object
toProjectId
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"to_project_id"
,
toProjectId
,
true
);
Response
response
=
post
(
Response
.
Status
.
OK
,
formData
,
"projects"
,
this
.
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"move"
);
return
(
response
.
readEntity
(
Issue
.
class
));
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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