Commit 6fb31590 authored by Paul Weingardt's avatar Paul Weingardt

added GitlabIssue.Action enum for issue editing

parent a0e81e3f
......@@ -282,6 +282,28 @@ public class GitlabAPI {
return requestor.to(tailUrl, GitlabIssue.class);
}
public GitlabIssue editIssue(int projectId, int issueId, int assigneeId, int milestoneId, String labels,
String description, String title, GitlabIssue.Action action) throws IOException {
String tailUrl = GitlabProject.URL + "/" + projectId + GitlabIssue.URL + "/" + issueId;
GitlabHTTPRequestor requestor = retrieve().method("PUT").with("title", title)
.with("description", description)
.with("labels", labels);
if(assigneeId != 0) {
requestor.with("assignee_id", assigneeId);
}
if(milestoneId != 0) {
requestor.with("milestone_id", milestoneId);
}
if(action != GitlabIssue.Action.LEAVE) {
requestor.with("state_event", action.toString().toLowerCase());
}
return requestor.to(tailUrl, GitlabIssue.class);
}
public List<GitlabNote> getNotes(GitlabIssue issue) throws IOException {
String tailUrl = GitlabProject.URL + "/" + issue.getProjectId() + GitlabIssue.URL + "/"
+ issue.getId() + GitlabNote.URL;
......
......@@ -5,6 +5,10 @@ import java.util.Date;
import org.codehaus.jackson.annotate.JsonProperty;
public class GitlabIssue {
public enum Action {
LEAVE, CLOSE, REOPEN
}
public static final String URL = "/issues";
private int _id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment