Skip to content

Commit 1cbf1c6

Browse files
committed
Merge remote-tracking branch 'origin/main' into 6.x
2 parents d84eab7 + 0c4c5c5 commit 1cbf1c6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/org/gitlab4j/api/IssuesApi.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,27 @@ public Issue closeIssue(Object projectIdOrPath, Long issueIid) throws GitLabApiE
489489
return (response.readEntity(Issue.class));
490490
}
491491

492+
/**
493+
* Reopens an existing project issue.
494+
*
495+
* <pre><code>GitLab Endpoint: PUT /projects/:id/issues/:issue_iid</code></pre>
496+
*
497+
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required
498+
* @param issueIid the issue IID to update, required
499+
* @return an instance of the updated Issue
500+
* @throws GitLabApiException if any exception occurs
501+
*/
502+
public Issue reopenIssue(Object projectIdOrPath, Long issueIid) throws GitLabApiException {
503+
504+
if (issueIid == null) {
505+
throw new RuntimeException("issue IID cannot be null");
506+
}
507+
508+
GitLabApiForm formData = new GitLabApiForm().withParam("state_event", StateEvent.REOPEN);
509+
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
510+
return (response.readEntity(Issue.class));
511+
}
512+
492513
/**
493514
* Updates an existing project issue. This call can also be used to mark an issue as closed.
494515
*

0 commit comments

Comments
 (0)