Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reopenIssue api in IssuesApi #1042 #1043

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/main/java/org/gitlab4j/api/IssuesApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,27 @@ public Issue closeIssue(Object projectIdOrPath, Long issueIid) throws GitLabApiE
return (response.readEntity(Issue.class));
}

/**
* Reopens an existing project issue.
*
* <pre><code>GitLab Endpoint: PUT /projects/:id/issues/:issue_iid</code></pre>
*
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required
* @param issueIid the issue IID to update, required
* @return an instance of the updated Issue
* @throws GitLabApiException if any exception occurs
*/
public Issue reopenIssue(Object projectIdOrPath, Long issueIid) throws GitLabApiException {

if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}

GitLabApiForm formData = new GitLabApiForm().withParam("state_event", StateEvent.REOPEN);
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
}

/**
* Updates an existing project issue. This call can also be used to mark an issue as closed.
*
Expand Down
Loading