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
04561b0f
Commit
04561b0f
authored
Apr 10, 2019
by
Greg Messner
Browse files
Added support for creating, updating, and deleting an issue board (#316).
parent
97f45725
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/BoardsApi.java
View file @
04561b0f
...
@@ -115,6 +115,69 @@ public class BoardsApi extends AbstractApi {
...
@@ -115,6 +115,69 @@ public class BoardsApi extends AbstractApi {
}
}
}
}
/**
* Creates a new Issue Board.
*
* <p>NOTE: This is only available in GitLab EE</p>
*
* <pre><code>GitLab Endpoint: POST /projects/:id/boards</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param name the name for the new board
* @return the created Board instance
* @throws GitLabApiException if any exception occurs
*/
public
Board
createBoard
(
Object
projectIdOrPath
,
String
name
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"name"
,
name
,
true
);
Response
response
=
post
(
Response
.
Status
.
CREATED
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"boards"
);
return
(
response
.
readEntity
(
Board
.
class
));
}
/**
* Updates an existing Issue Board.
*
* <p>NOTE: This is only available in GitLab EE</p>
*
* <pre><code>GitLab Endpoint: PUT /projects/:id/boards/:board_id</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param boardId the ID of the board, required
* @param name the new name of the board, optional (can be null)
* @param assigneeId the assignee the board should be scoped to, optional (can be null)
* @param milestoneId the milestone the board should be scoped to, optional (can be null)
* @param labels a comma-separated list of label names which the board should be scoped to, optional (can be null)
* @param weight the weight range from 0 to 9, to which the board should be scoped to, optional (can be null)
* @return the updated Board instance
* @throws GitLabApiException if any exception occurs
*/
public
BoardList
updateBoard
(
Object
projectIdOrPath
,
Integer
boardId
,
String
name
,
Integer
assigneeId
,
Integer
milestoneId
,
String
labels
,
Integer
weight
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
"name"
,
name
)
.
withParam
(
"assignee_id"
,
assigneeId
)
.
withParam
(
"milestone_id"
,
milestoneId
)
.
withParam
(
"labels"
,
labels
)
.
withParam
(
"weight"
,
weight
);
Response
response
=
put
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"boards"
,
boardId
);
return
(
response
.
readEntity
(
BoardList
.
class
));
}
/**
* Soft deletes an existing Issue Board.
*
* <p>NOTE: This is only available in GitLab EE</p>
*
* <pre><code>GitLab Endpoint: DELETE /projects/:id/boards/:board_id</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @param boardId the ID of the board
* @throws GitLabApiException if any exception occurs
*/
public
void
deleteBoard
(
Object
projectIdOrPath
,
Integer
boardId
)
throws
GitLabApiException
{
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"boards"
,
boardId
);
}
/**
/**
* Get a list of the board’s lists. Does not include open and closed lists.
* Get a list of the board’s lists. Does not include open and closed lists.
*
*
...
...
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