Repository: hub4j/github-api
Pull request #1774 (2024-01-01 02:36:13)

Chore(deps): Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>What's Changed</h2>
<p>The release of upload-artifact@v4 and download-artifact@v4 are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.</p>
<p>For more information, see the <a href="https://github.com/actions/toolkit/tree/main/packages/artifact"><code>@​actions/artifact</code></a> documentation.</p>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/vmjoseph"><code>@​vmjoseph</code></a> made their first contribution in <a href="https://redirect.github.com/actions/upload-artifact/pull/464">actions/upload-artifact#464</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v4.0.0">https://github.com/actions/upload-artifact/compare/v3...v4.0.0</a></p>
<h2>v3.1.3</h2>
<h2>What's Changed</h2>
<ul>
<li>chore(github): remove trailing whitespaces by <a href="https://github.com/ljmf00"><code>@​ljmf00</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/313">actions/upload-artifact#313</a></li>
<li>Bump <code>@​actions/artifact</code> version to v1.1.2 by <a href="https://github.com/bethanyj28"><code>@​bethanyj28</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/436">actions/upload-artifact#436</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v3.1.3">https://github.com/actions/upload-artifact/compare/v3...v3.1.3</a></p>
<h2>v3.1.2</h2>
<ul>
<li>Update all <code>@actions/*</code> NPM packages to their latest versions- <a href="https://redirect.github.com/actions/upload-artifact/issues/374">#374</a></li>
<li>Update all dev dependencies to their most recent versions - <a href="https://redirect.github.com/actions/upload-artifact/issues/375">#375</a></li>
</ul>
<h2>v3.1.1</h2>
<ul>
<li>Update actions/core package to latest version to remove <code>set-output</code> deprecation warning <a href="https://redirect.github.com/actions/upload-artifact/issues/351">#351</a></li>
</ul>
<h2>v3.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump <code>@​actions/artifact</code> to v1.1.0 (<a href="https://redirect.github.com/actions/upload-artifact/pull/327">actions/upload-artifact#327</a>)
<ul>
<li>Adds checksum headers on artifact upload (<a href="https://redirect.github.com/actions/toolkit/pull/1095">actions/toolkit#1095</a>) (<a href="https://redirect.github.com/actions/toolkit/pull/1063">actions/toolkit#1063</a>)</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/actions/upload-artifact/commit/c7d193f32edcb7bfad88892161225aeda64e9392"><code>c7d193f</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/466">#466</a> from actions/v4-beta</li>
<li><a href="https://github.com/actions/upload-artifact/commit/13131bb095770b4070a7477c3cd2d96e1c16d9f4"><code>13131bb</code></a> licensed cache</li>
<li><a href="https://github.com/actions/upload-artifact/commit/4a6c273b9834f66a1d05c170dc3f80f9cdb9def1"><code>4a6c273</code></a> Merge branch 'main' into v4-beta</li>
<li><a href="https://github.com/actions/upload-artifact/commit/f391bb91a3d3118aeca171c365bb319ece276b37"><code>f391bb9</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/465">#465</a> from actions/robherley/v4-documentation</li>
<li><a href="https://github.com/actions/upload-artifact/commit/9653d03c4b74c32144e02dae644fea70e079d4b3"><code>9653d03</code></a> Apply suggestions from code review</li>
<li><a href="https://github.com/actions/upload-artifact/commit/875b63076402f25ef9d52c294c86ba4f97810575"><code>875b630</code></a> add limitations section</li>
<li><a href="https://github.com/actions/upload-artifact/commit/ecb21463e93740a6be75c3116242169bfdbcb15a"><code>ecb2146</code></a> add compression example</li>
<li><a href="https://github.com/actions/upload-artifact/commit/5e7604f84a055838f64ed68bb9904751523081ae"><code>5e7604f</code></a> trim some repeated info</li>
<li><a href="https://github.com/actions/upload-artifact/commit/d6437d07581fe318a364512e6cf6b1dca6b4f92c"><code>d6437d0</code></a> naming</li>
<li><a href="https://github.com/actions/upload-artifact/commit/1b561557037b4957d7d184e9aac02bec86c771eb"><code>1b56155</code></a> s/v4-beta/v4/g</li>
<li>Additional commits viewable in <a href="https://github.com/actions/upload-artifact/compare/v3...v4">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/upload-artifact&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/hub4j/github-api/pull/1774?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hub4j) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`b59937a`)](https://app.codecov.io/gh/hub4j/github-api/commit/b59937a4003cb7ddfef82e6845374d2198487d10?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hub4j) 80.41% compared to head [(`2c6e2f6`)](https://app.codecov.io/gh/hub4j/github-api/pull/1774?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hub4j) 80.41%.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##               main    #1774   +/-   ##
=========================================
  Coverage     80.41%   80.41%           
  Complexity     2309     2309           
=========================================
  Files           218      218           
  Lines          7016     7016           
  Branches        371      371           
=========================================
  Hits           5642     5642           
  Misses         1141     1141           
  Partials        233      233           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/hub4j/github-api/pull/1774?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hub4j).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hub4j).


Patch:
diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml
index f055363cf..6bdf94c33 100644
--- a/.github/workflows/maven-build.yml
+++ b/.github/workflows/maven-build.yml
@@ -35,7 +35,7 @@ jobs:
       env:
         MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
       run: mvn -B clean install -DskipTests --file pom.xml
-    - uses: actions/upload-artifact@v3
+    - uses: actions/upload-artifact@v4
       with:
         name: maven-target-directory
         path: target/
@@ -94,7 +94,7 @@ jobs:
     runs-on: ubuntu-latest
     steps: 
     - uses: actions/checkout@v4
-    - uses: actions/download-artifact@v3
+    - uses: actions/download-artifact@v4
       with:
         name: maven-target-directory
         path: target
diff --git a/.github/workflows/publish_release_branch.yml b/.github/workflows/publish_release_branch.yml
index 995452ea8..afbfcc9a4 100644
--- a/.github/workflows/publish_release_branch.yml
+++ b/.github/workflows/publish_release_branch.yml
@@ -29,7 +29,7 @@ jobs:
           MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
         run: mvn -B clean install site -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
           name: maven-target-directory
           path: target/
diff --git a/src/main/java/org/kohsuke/github/GHIssue.java b/src/main/java/org/kohsuke/github/GHIssue.java
index 9d6027f33..0f031b3b4 100644
--- a/src/main/java/org/kohsuke/github/GHIssue.java
+++ b/src/main/java/org/kohsuke/github/GHIssue.java
@@ -27,6 +27,7 @@ package org.kohsuke.github;
 import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.apache.commons.lang3.StringUtils;
+import org.kohsuke.github.internal.EnumUtils;
 
 import java.io.IOException;
 import java.net.URL;
@@ -35,8 +36,10 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Objects;
 
 import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
@@ -67,6 +70,9 @@ public class GHIssue extends GHObject implements Reactable {
     /** The state. */
     protected String state;
 
+    /** The state reason. */
+    protected String state_reason;
+
     /** The number. */
     protected int number;
 
@@ -198,6 +204,15 @@ public class GHIssue extends GHObject implements Reactable {
         return Enum.valueOf(GHIssueState.class, state.toUpperCase(Locale.ENGLISH));
     }
 
+    /**
+     * Gets state reason.
+     *
+     * @return the state reason
+     */
+    public GHIssueStateReason getStateReason() {
+        return EnumUtils.getNullableEnumOrDefault(GHIssueStateReason.class, state_reason, GHIssueStateReason.UNKNOWN);
+    }
+
     /**
      * Gets labels.
      *
@@ -273,6 +288,10 @@ public class GHIssue extends GHObject implements Reactable {
         root().createRequest().with(key, value).method("PATCH").withUrlPath(getApiRoute()).send();
     }
 
+    private void edit(Map<String, Object> map) throws IOException {
+        root().createRequest().with(map).method("PATCH").withUrlPath(getApiRoute()).send();
+    }
+
     /**
      * Identical to edit(), but allows null for the value.
      */
@@ -294,6 +313,21 @@ public class GHIssue extends GHObject implements Reactable {
         edit("state", "closed");
     }
 
+    /**
+     * Closes this issue.
+     *
+     * @param reason
+     *            the reason the issue was closed
+     * @throws IOException
+     *             the io exception
+     */
+    public void close(GHIssueStateReason reason) throws IOException {
+        Map<String, Object> map = new HashMap<>();
+        map.put("state", "closed");
+        map.put("state_reason", reason.name().toLowerCase(Locale.ENGLISH));
+        edit(map);
+    }
+
     /**
      * Reopens this issue.
      *
diff --git a/src/main/java/org/kohsuke/github/GHIssueStateReason.java b/src/main/java/org/kohsuke/github/GHIssueStateReason.java
new file mode 100644
index 000000000..229af9f6e
--- /dev/null
+++ b/src/main/java/org/kohsuke/github/GHIssueStateReason.java
@@ -0,0 +1,16 @@
+package org.kohsuke.github;
+
+/**
+ * The enum GHIssueStateReason.
+ */
+public enum GHIssueStateReason {
+
+    /** Completed **/
+    COMPLETED,
+
+    /** Closed as not planned **/
+    NOT_PLANNED,
+
+    /** Uknown **/
+    UNKNOWN
+}


Test patch:
diff --git a/src/test/java/org/kohsuke/github/GHIssueTest.java b/src/test/java/org/kohsuke/github/GHIssueTest.java
index b86910cf2..a0416f4de 100644
--- a/src/test/java/org/kohsuke/github/GHIssueTest.java
+++ b/src/test/java/org/kohsuke/github/GHIssueTest.java
@@ -18,6 +18,7 @@ import static org.hamcrest.Matchers.hasProperty;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.nullValue;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -158,7 +159,33 @@ public class GHIssueTest extends AbstractGitHubWireMockTest {
         assertThat(issue.getTitle(), equalTo(name));
         assertThat(getRepository().getIssue(issue.getNumber()).getState(), equalTo(GHIssueState.OPEN));
         issue.close();
-        assertThat(getRepository().getIssue(issue.getNumber()).getState(), equalTo(GHIssueState.CLOSED));
+        GHIssue closedIssued = getRepository().getIssue(issue.getNumber());
+        assertThat(closedIssued.getState(), equalTo(GHIssueState.CLOSED));
+        assertThat(closedIssued.getStateReason(), equalTo(GHIssueStateReason.COMPLETED));
+    }
+
+    /**
+     * Close issue as not planned.
+     *
+     * @throws Exception
+     *             the exception
+     */
+    @Test
+    public void closeIssueNotPlanned() throws Exception {
+        String name = "closeIssueNotPlanned";
+        GHIssue issue = getRepository().createIssue(name).body("## test").create();
+        assertThat(issue.getTitle(), equalTo(name));
+
+        GHIssue createdIssue = issue.getRepository().getIssue(issue.getNumber());
+
+        assertThat(createdIssue.getState(), equalTo(GHIssueState.OPEN));
+        assertThat(createdIssue.getStateReason(), nullValue());
+
+        issue.close(GHIssueStateReason.NOT_PLANNED);
+
+        GHIssue closedIssued = getRepository().getIssue(issue.getNumber());
+        assertThat(closedIssued.getState(), equalTo(GHIssueState.CLOSED));
+        assertThat(closedIssued.getStateReason(), equalTo(GHIssueStateReason.NOT_PLANNED));
     }
 
     /**
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/1-user.json
new file mode 100644
index 000000000..081061acf
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/1-user.json
@@ -0,0 +1,34 @@
+{
+  "login": "stianst",
+  "id": 2271511,
+  "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+  "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+  "gravatar_id": "",
+  "url": "https://api.github.com/users/stianst",
+  "html_url": "https://github.com/stianst",
+  "followers_url": "https://api.github.com/users/stianst/followers",
+  "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+  "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+  "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+  "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+  "organizations_url": "https://api.github.com/users/stianst/orgs",
+  "repos_url": "https://api.github.com/users/stianst/repos",
+  "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+  "received_events_url": "https://api.github.com/users/stianst/received_events",
+  "type": "User",
+  "site_admin": false,
+  "name": "Stian Thorgersen",
+  "company": "Red Hat",
+  "blog": "",
+  "location": null,
+  "email": "stian@redhat.com",
+  "hireable": null,
+  "bio": "Keycloak Project Lead",
+  "twitter_username": null,
+  "public_repos": 39,
+  "public_gists": 20,
+  "followers": 454,
+  "following": 1,
+  "created_at": "2012-09-03T14:55:29Z",
+  "updated_at": "2023-11-20T07:52:25Z"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/2-orgs_hub4j-test-org.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/2-orgs_hub4j-test-org.json
new file mode 100644
index 000000000..e6021af93
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/2-orgs_hub4j-test-org.json
@@ -0,0 +1,66 @@
+{
+  "login": "hub4j-test-org",
+  "id": 7544739,
+  "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
+  "url": "https://api.github.com/orgs/hub4j-test-org",
+  "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
+  "events_url": "https://api.github.com/orgs/hub4j-test-org/events",
+  "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
+  "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
+  "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
+  "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
+  "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
+  "description": "Hub4j Test Org Description (this could be null or blank too)",
+  "name": "Hub4j Test Org Name (this could be null or blank too)",
+  "company": null,
+  "blog": "https://hub4j.url.io/could/be/null",
+  "location": "Hub4j Test Org Location (this could be null or blank too)",
+  "email": "hub4jtestorgemail@could.be.null.com",
+  "twitter_username": null,
+  "is_verified": false,
+  "has_organization_projects": true,
+  "has_repository_projects": true,
+  "public_repos": 26,
+  "public_gists": 0,
+  "followers": 2,
+  "following": 0,
+  "html_url": "https://github.com/hub4j-test-org",
+  "created_at": "2014-05-10T19:39:11Z",
+  "updated_at": "2020-06-04T05:56:10Z",
+  "archived_at": null,
+  "type": "Organization",
+  "total_private_repos": 6,
+  "owned_private_repos": 6,
+  "private_gists": 0,
+  "disk_usage": 12014,
+  "collaborators": 1,
+  "billing_email": "kk@kohsuke.org",
+  "default_repository_permission": "none",
+  "members_can_create_repositories": false,
+  "two_factor_requirement_enabled": false,
+  "members_allowed_repository_creation_type": "none",
+  "members_can_create_public_repositories": false,
+  "members_can_create_private_repositories": false,
+  "members_can_create_internal_repositories": false,
+  "members_can_create_pages": true,
+  "members_can_fork_private_repositories": false,
+  "web_commit_signoff_required": false,
+  "members_can_create_public_pages": true,
+  "members_can_create_private_pages": true,
+  "plan": {
+    "name": "free",
+    "space": 976562499,
+    "private_repos": 10000,
+    "filled_seats": 49,
+    "seats": 3
+  },
+  "advanced_security_enabled_for_new_repositories": false,
+  "dependabot_alerts_enabled_for_new_repositories": false,
+  "dependabot_security_updates_enabled_for_new_repositories": false,
+  "dependency_graph_enabled_for_new_repositories": false,
+  "secret_scanning_enabled_for_new_repositories": false,
+  "secret_scanning_push_protection_enabled_for_new_repositories": false,
+  "secret_scanning_push_protection_custom_link_enabled": false,
+  "secret_scanning_push_protection_custom_link": null,
+  "secret_scanning_validity_checks_enabled": false
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/3-r_h_ghissuetest.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/3-r_h_ghissuetest.json
new file mode 100644
index 000000000..dc7ff152d
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/3-r_h_ghissuetest.json
@@ -0,0 +1,156 @@
+{
+  "id": 539903172,
+  "node_id": "R_kgDOIC5ExA",
+  "name": "GHIssueTest",
+  "full_name": "hub4j-test-org/GHIssueTest",
+  "private": true,
+  "owner": {
+    "login": "hub4j-test-org",
+    "id": 7544739,
+    "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/hub4j-test-org",
+    "html_url": "https://github.com/hub4j-test-org",
+    "followers_url": "https://api.github.com/users/hub4j-test-org/followers",
+    "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
+    "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
+    "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
+    "repos_url": "https://api.github.com/users/hub4j-test-org/repos",
+    "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
+    "type": "Organization",
+    "site_admin": false
+  },
+  "html_url": "https://github.com/hub4j-test-org/GHIssueTest",
+  "description": "Repository used by GHIssueTest",
+  "fork": false,
+  "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest",
+  "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks",
+  "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}",
+  "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}",
+  "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams",
+  "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks",
+  "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}",
+  "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events",
+  "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}",
+  "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}",
+  "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags",
+  "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}",
+  "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}",
+  "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}",
+  "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}",
+  "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}",
+  "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages",
+  "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers",
+  "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors",
+  "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers",
+  "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription",
+  "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}",
+  "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}",
+  "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}",
+  "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}",
+  "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}",
+  "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}",
+  "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges",
+  "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}",
+  "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads",
+  "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}",
+  "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}",
+  "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}",
+  "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}",
+  "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}",
+  "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}",
+  "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments",
+  "created_at": "2022-09-22T09:33:05Z",
+  "updated_at": "2022-09-22T09:33:16Z",
+  "pushed_at": "2022-09-22T09:33:05Z",
+  "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git",
+  "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git",
+  "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git",
+  "svn_url": "https://github.com/hub4j-test-org/GHIssueTest",
+  "homepage": null,
+  "size": 0,
+  "stargazers_count": 0,
+  "watchers_count": 0,
+  "language": null,
+  "has_issues": true,
+  "has_projects": true,
+  "has_downloads": true,
+  "has_wiki": false,
+  "has_pages": false,
+  "has_discussions": false,
+  "forks_count": 0,
+  "mirror_url": null,
+  "archived": false,
+  "disabled": false,
+  "open_issues_count": 0,
+  "license": null,
+  "allow_forking": false,
+  "is_template": false,
+  "web_commit_signoff_required": false,
+  "topics": [],
+  "visibility": "private",
+  "forks": 0,
+  "open_issues": 0,
+  "watchers": 0,
+  "default_branch": "main",
+  "permissions": {
+    "admin": true,
+    "maintain": true,
+    "push": true,
+    "triage": true,
+    "pull": true
+  },
+  "temp_clone_token": "AARKSFYLQOBOSCZJCPGLQMTFZSKWQ",
+  "allow_squash_merge": true,
+  "allow_merge_commit": true,
+  "allow_rebase_merge": true,
+  "allow_auto_merge": false,
+  "delete_branch_on_merge": false,
+  "allow_update_branch": false,
+  "use_squash_pr_title_as_default": false,
+  "squash_merge_commit_message": "COMMIT_MESSAGES",
+  "squash_merge_commit_title": "COMMIT_OR_PR_TITLE",
+  "merge_commit_message": "PR_TITLE",
+  "merge_commit_title": "MERGE_MESSAGE",
+  "custom_properties": {},
+  "organization": {
+    "login": "hub4j-test-org",
+    "id": 7544739,
+    "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/hub4j-test-org",
+    "html_url": "https://github.com/hub4j-test-org",
+    "followers_url": "https://api.github.com/users/hub4j-test-org/followers",
+    "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
+    "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
+    "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
+    "repos_url": "https://api.github.com/users/hub4j-test-org/repos",
+    "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
+    "type": "Organization",
+    "site_admin": false
+  },
+  "security_and_analysis": {
+    "secret_scanning": {
+      "status": "disabled"
+    },
+    "secret_scanning_push_protection": {
+      "status": "disabled"
+    },
+    "dependabot_security_updates": {
+      "status": "disabled"
+    },
+    "secret_scanning_validity_checks": {
+      "status": "disabled"
+    }
+  },
+  "network_count": 0,
+  "subscribers_count": 15
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/4-r_h_g_issues.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/4-r_h_g_issues.json
new file mode 100644
index 000000000..01b29e3c1
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/4-r_h_g_issues.json
@@ -0,0 +1,61 @@
+{
+  "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18",
+  "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest",
+  "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/labels{/name}",
+  "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/comments",
+  "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/events",
+  "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/18",
+  "id": 2134002770,
+  "node_id": "I_kwDOIC5ExM5_MkxS",
+  "number": 18,
+  "title": "closeIssueNotPlanned",
+  "user": {
+    "login": "stianst",
+    "id": 2271511,
+    "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/stianst",
+    "html_url": "https://github.com/stianst",
+    "followers_url": "https://api.github.com/users/stianst/followers",
+    "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+    "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+    "organizations_url": "https://api.github.com/users/stianst/orgs",
+    "repos_url": "https://api.github.com/users/stianst/repos",
+    "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/stianst/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "labels": [],
+  "state": "open",
+  "locked": false,
+  "assignee": null,
+  "assignees": [],
+  "milestone": null,
+  "comments": 0,
+  "created_at": "2024-02-14T10:21:48Z",
+  "updated_at": "2024-02-14T10:21:48Z",
+  "closed_at": null,
+  "author_association": "NONE",
+  "active_lock_reason": null,
+  "body": "## test",
+  "closed_by": null,
+  "reactions": {
+    "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/reactions",
+    "total_count": 0,
+    "+1": 0,
+    "-1": 0,
+    "laugh": 0,
+    "hooray": 0,
+    "confused": 0,
+    "heart": 0,
+    "rocket": 0,
+    "eyes": 0
+  },
+  "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/timeline",
+  "performed_via_github_app": null,
+  "state_reason": null
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/5-r_h_g_issues_18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/5-r_h_g_issues_18.json
new file mode 100644
index 000000000..01b29e3c1
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/5-r_h_g_issues_18.json
@@ -0,0 +1,61 @@
+{
+  "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18",
+  "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest",
+  "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/labels{/name}",
+  "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/comments",
+  "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/events",
+  "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/18",
+  "id": 2134002770,
+  "node_id": "I_kwDOIC5ExM5_MkxS",
+  "number": 18,
+  "title": "closeIssueNotPlanned",
+  "user": {
+    "login": "stianst",
+    "id": 2271511,
+    "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/stianst",
+    "html_url": "https://github.com/stianst",
+    "followers_url": "https://api.github.com/users/stianst/followers",
+    "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+    "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+    "organizations_url": "https://api.github.com/users/stianst/orgs",
+    "repos_url": "https://api.github.com/users/stianst/repos",
+    "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/stianst/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "labels": [],
+  "state": "open",
+  "locked": false,
+  "assignee": null,
+  "assignees": [],
+  "milestone": null,
+  "comments": 0,
+  "created_at": "2024-02-14T10:21:48Z",
+  "updated_at": "2024-02-14T10:21:48Z",
+  "closed_at": null,
+  "author_association": "NONE",
+  "active_lock_reason": null,
+  "body": "## test",
+  "closed_by": null,
+  "reactions": {
+    "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/reactions",
+    "total_count": 0,
+    "+1": 0,
+    "-1": 0,
+    "laugh": 0,
+    "hooray": 0,
+    "confused": 0,
+    "heart": 0,
+    "rocket": 0,
+    "eyes": 0
+  },
+  "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/timeline",
+  "performed_via_github_app": null,
+  "state_reason": null
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/6-r_h_g_issues_18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/6-r_h_g_issues_18.json
new file mode 100644
index 000000000..a5261d868
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/6-r_h_g_issues_18.json
@@ -0,0 +1,80 @@
+{
+  "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18",
+  "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest",
+  "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/labels{/name}",
+  "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/comments",
+  "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/events",
+  "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/18",
+  "id": 2134002770,
+  "node_id": "I_kwDOIC5ExM5_MkxS",
+  "number": 18,
+  "title": "closeIssueNotPlanned",
+  "user": {
+    "login": "stianst",
+    "id": 2271511,
+    "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/stianst",
+    "html_url": "https://github.com/stianst",
+    "followers_url": "https://api.github.com/users/stianst/followers",
+    "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+    "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+    "organizations_url": "https://api.github.com/users/stianst/orgs",
+    "repos_url": "https://api.github.com/users/stianst/repos",
+    "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/stianst/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "labels": [],
+  "state": "closed",
+  "locked": false,
+  "assignee": null,
+  "assignees": [],
+  "milestone": null,
+  "comments": 0,
+  "created_at": "2024-02-14T10:21:48Z",
+  "updated_at": "2024-02-14T10:21:50Z",
+  "closed_at": "2024-02-14T10:21:49Z",
+  "author_association": "NONE",
+  "active_lock_reason": null,
+  "body": "## test",
+  "closed_by": {
+    "login": "stianst",
+    "id": 2271511,
+    "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/stianst",
+    "html_url": "https://github.com/stianst",
+    "followers_url": "https://api.github.com/users/stianst/followers",
+    "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+    "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+    "organizations_url": "https://api.github.com/users/stianst/orgs",
+    "repos_url": "https://api.github.com/users/stianst/repos",
+    "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/stianst/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "reactions": {
+    "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/reactions",
+    "total_count": 0,
+    "+1": 0,
+    "-1": 0,
+    "laugh": 0,
+    "hooray": 0,
+    "confused": 0,
+    "heart": 0,
+    "rocket": 0,
+    "eyes": 0
+  },
+  "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/timeline",
+  "performed_via_github_app": null,
+  "state_reason": "not_planned"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/7-r_h_ghissuetest.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/7-r_h_ghissuetest.json
new file mode 100644
index 000000000..abb52eddc
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/7-r_h_ghissuetest.json
@@ -0,0 +1,156 @@
+{
+  "id": 539903172,
+  "node_id": "R_kgDOIC5ExA",
+  "name": "GHIssueTest",
+  "full_name": "hub4j-test-org/GHIssueTest",
+  "private": true,
+  "owner": {
+    "login": "hub4j-test-org",
+    "id": 7544739,
+    "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/hub4j-test-org",
+    "html_url": "https://github.com/hub4j-test-org",
+    "followers_url": "https://api.github.com/users/hub4j-test-org/followers",
+    "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
+    "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
+    "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
+    "repos_url": "https://api.github.com/users/hub4j-test-org/repos",
+    "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
+    "type": "Organization",
+    "site_admin": false
+  },
+  "html_url": "https://github.com/hub4j-test-org/GHIssueTest",
+  "description": "Repository used by GHIssueTest",
+  "fork": false,
+  "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest",
+  "forks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/forks",
+  "keys_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/keys{/key_id}",
+  "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/collaborators{/collaborator}",
+  "teams_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/teams",
+  "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/hooks",
+  "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/events{/number}",
+  "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/events",
+  "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/assignees{/user}",
+  "branches_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/branches{/branch}",
+  "tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/tags",
+  "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/blobs{/sha}",
+  "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/tags{/sha}",
+  "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/refs{/sha}",
+  "trees_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/trees{/sha}",
+  "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/statuses/{sha}",
+  "languages_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/languages",
+  "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/stargazers",
+  "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contributors",
+  "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscribers",
+  "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/subscription",
+  "commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/commits{/sha}",
+  "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/git/commits{/sha}",
+  "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/comments{/number}",
+  "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/comments{/number}",
+  "contents_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/contents/{+path}",
+  "compare_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/compare/{base}...{head}",
+  "merges_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/merges",
+  "archive_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/{archive_format}{/ref}",
+  "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/downloads",
+  "issues_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues{/number}",
+  "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/pulls{/number}",
+  "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/milestones{/number}",
+  "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/notifications{?since,all,participating}",
+  "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/labels{/name}",
+  "releases_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/releases{/id}",
+  "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/deployments",
+  "created_at": "2022-09-22T09:33:05Z",
+  "updated_at": "2022-09-22T09:33:16Z",
+  "pushed_at": "2022-09-22T09:33:05Z",
+  "git_url": "git://github.com/hub4j-test-org/GHIssueTest.git",
+  "ssh_url": "git@github.com:hub4j-test-org/GHIssueTest.git",
+  "clone_url": "https://github.com/hub4j-test-org/GHIssueTest.git",
+  "svn_url": "https://github.com/hub4j-test-org/GHIssueTest",
+  "homepage": null,
+  "size": 0,
+  "stargazers_count": 0,
+  "watchers_count": 0,
+  "language": null,
+  "has_issues": true,
+  "has_projects": true,
+  "has_downloads": true,
+  "has_wiki": false,
+  "has_pages": false,
+  "has_discussions": false,
+  "forks_count": 0,
+  "mirror_url": null,
+  "archived": false,
+  "disabled": false,
+  "open_issues_count": 0,
+  "license": null,
+  "allow_forking": false,
+  "is_template": false,
+  "web_commit_signoff_required": false,
+  "topics": [],
+  "visibility": "private",
+  "forks": 0,
+  "open_issues": 0,
+  "watchers": 0,
+  "default_branch": "main",
+  "permissions": {
+    "admin": true,
+    "maintain": true,
+    "push": true,
+    "triage": true,
+    "pull": true
+  },
+  "temp_clone_token": "AARKSF3KWMM55GDRU3FGP7DFZSKWU",
+  "allow_squash_merge": true,
+  "allow_merge_commit": true,
+  "allow_rebase_merge": true,
+  "allow_auto_merge": false,
+  "delete_branch_on_merge": false,
+  "allow_update_branch": false,
+  "use_squash_pr_title_as_default": false,
+  "squash_merge_commit_message": "COMMIT_MESSAGES",
+  "squash_merge_commit_title": "COMMIT_OR_PR_TITLE",
+  "merge_commit_message": "PR_TITLE",
+  "merge_commit_title": "MERGE_MESSAGE",
+  "custom_properties": {},
+  "organization": {
+    "login": "hub4j-test-org",
+    "id": 7544739,
+    "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/hub4j-test-org",
+    "html_url": "https://github.com/hub4j-test-org",
+    "followers_url": "https://api.github.com/users/hub4j-test-org/followers",
+    "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}",
+    "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions",
+    "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs",
+    "repos_url": "https://api.github.com/users/hub4j-test-org/repos",
+    "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events",
+    "type": "Organization",
+    "site_admin": false
+  },
+  "security_and_analysis": {
+    "secret_scanning": {
+      "status": "disabled"
+    },
+    "secret_scanning_push_protection": {
+      "status": "disabled"
+    },
+    "dependabot_security_updates": {
+      "status": "disabled"
+    },
+    "secret_scanning_validity_checks": {
+      "status": "disabled"
+    }
+  },
+  "network_count": 0,
+  "subscribers_count": 15
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/8-r_h_g_issues_18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/8-r_h_g_issues_18.json
new file mode 100644
index 000000000..a5261d868
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/__files/8-r_h_g_issues_18.json
@@ -0,0 +1,80 @@
+{
+  "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18",
+  "repository_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest",
+  "labels_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/labels{/name}",
+  "comments_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/comments",
+  "events_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/events",
+  "html_url": "https://github.com/hub4j-test-org/GHIssueTest/issues/18",
+  "id": 2134002770,
+  "node_id": "I_kwDOIC5ExM5_MkxS",
+  "number": 18,
+  "title": "closeIssueNotPlanned",
+  "user": {
+    "login": "stianst",
+    "id": 2271511,
+    "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/stianst",
+    "html_url": "https://github.com/stianst",
+    "followers_url": "https://api.github.com/users/stianst/followers",
+    "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+    "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+    "organizations_url": "https://api.github.com/users/stianst/orgs",
+    "repos_url": "https://api.github.com/users/stianst/repos",
+    "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/stianst/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "labels": [],
+  "state": "closed",
+  "locked": false,
+  "assignee": null,
+  "assignees": [],
+  "milestone": null,
+  "comments": 0,
+  "created_at": "2024-02-14T10:21:48Z",
+  "updated_at": "2024-02-14T10:21:50Z",
+  "closed_at": "2024-02-14T10:21:49Z",
+  "author_association": "NONE",
+  "active_lock_reason": null,
+  "body": "## test",
+  "closed_by": {
+    "login": "stianst",
+    "id": 2271511,
+    "node_id": "MDQ6VXNlcjIyNzE1MTE=",
+    "avatar_url": "https://avatars.githubusercontent.com/u/2271511?v=4",
+    "gravatar_id": "",
+    "url": "https://api.github.com/users/stianst",
+    "html_url": "https://github.com/stianst",
+    "followers_url": "https://api.github.com/users/stianst/followers",
+    "following_url": "https://api.github.com/users/stianst/following{/other_user}",
+    "gists_url": "https://api.github.com/users/stianst/gists{/gist_id}",
+    "starred_url": "https://api.github.com/users/stianst/starred{/owner}{/repo}",
+    "subscriptions_url": "https://api.github.com/users/stianst/subscriptions",
+    "organizations_url": "https://api.github.com/users/stianst/orgs",
+    "repos_url": "https://api.github.com/users/stianst/repos",
+    "events_url": "https://api.github.com/users/stianst/events{/privacy}",
+    "received_events_url": "https://api.github.com/users/stianst/received_events",
+    "type": "User",
+    "site_admin": false
+  },
+  "reactions": {
+    "url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/reactions",
+    "total_count": 0,
+    "+1": 0,
+    "-1": 0,
+    "laugh": 0,
+    "hooray": 0,
+    "confused": 0,
+    "heart": 0,
+    "rocket": 0,
+    "eyes": 0
+  },
+  "timeline_url": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18/timeline",
+  "performed_via_github_app": null,
+  "state_reason": "not_planned"
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/1-user.json
new file mode 100644
index 000000000..6172db440
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/1-user.json
@@ -0,0 +1,51 @@
+{
+  "id": "e0d100a9-886f-4fe6-8f4c-322f1db8279f",
+  "name": "user",
+  "request": {
+    "url": "/user",
+    "method": "GET",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    }
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "1-user.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:46 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"5cb3451f0db51cfd199cc5ae70f648e9a3e67ac4bfb9aa7d0ebb5c03415561f1\"",
+      "Last-Modified": "Mon, 20 Nov 2023 07:52:25 GMT",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4956",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "44",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "C378:1E6D6C:411DD18:41CC26D:65CC943A"
+    }
+  },
+  "uuid": "e0d100a9-886f-4fe6-8f4c-322f1db8279f",
+  "persistent": true,
+  "insertionIndex": 1
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/2-orgs_hub4j-test-org.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/2-orgs_hub4j-test-org.json
new file mode 100644
index 000000000..d6c4fcc2c
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/2-orgs_hub4j-test-org.json
@@ -0,0 +1,51 @@
+{
+  "id": "c0038ed3-4e2b-4da0-ba3e-8001b447f52e",
+  "name": "orgs_hub4j-test-org",
+  "request": {
+    "url": "/orgs/hub4j-test-org",
+    "method": "GET",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    }
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "2-orgs_hub4j-test-org.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:47 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"1201c15faa652603bb2bf40bb4ab77196a9e620c99738e08bac04970fda94a93\"",
+      "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4951",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "49",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "C380:1524DE:3EB06BD:3F5EA28:65CC943B"
+    }
+  },
+  "uuid": "c0038ed3-4e2b-4da0-ba3e-8001b447f52e",
+  "persistent": true,
+  "insertionIndex": 2
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/3-r_h_ghissuetest.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/3-r_h_ghissuetest.json
new file mode 100644
index 000000000..8a003892b
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/3-r_h_ghissuetest.json
@@ -0,0 +1,54 @@
+{
+  "id": "545eb0d7-85c4-429b-bf70-971f9f65ac0d",
+  "name": "repos_hub4j-test-org_ghissuetest",
+  "request": {
+    "url": "/repos/hub4j-test-org/GHIssueTest",
+    "method": "GET",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    }
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "3-r_h_ghissuetest.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:48 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"b2ac2191c1e9b1f08faeaaccb75edaddcb0a246463bc332277b765141bae9ead\"",
+      "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "repo",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4950",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "50",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "C384:22C8E2:401191F:40BE064:65CC943C"
+    }
+  },
+  "uuid": "545eb0d7-85c4-429b-bf70-971f9f65ac0d",
+  "persistent": true,
+  "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest",
+  "requiredScenarioState": "Started",
+  "newScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2",
+  "insertionIndex": 3
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/4-r_h_g_issues.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/4-r_h_g_issues.json
new file mode 100644
index 000000000..bfc1e93b1
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/4-r_h_g_issues.json
@@ -0,0 +1,58 @@
+{
+  "id": "7894ed05-62de-4370-aaf5-aca3e6f55872",
+  "name": "repos_hub4j-test-org_ghissuetest_issues",
+  "request": {
+    "url": "/repos/hub4j-test-org/GHIssueTest/issues",
+    "method": "POST",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    },
+    "bodyPatterns": [
+      {
+        "equalToJson": "{\"assignees\":[],\"title\":\"closeIssueNotPlanned\",\"body\":\"## test\",\"labels\":[]}",
+        "ignoreArrayOrder": true,
+        "ignoreExtraElements": false
+      }
+    ]
+  },
+  "response": {
+    "status": 201,
+    "bodyFileName": "4-r_h_g_issues.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:49 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "\"38680077efa24b88949bd249310b7631040d580a6aa11fee565a6153792eedd8\"",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4949",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "51",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "E5EE:78D7:3B70253:3C170B2:65CC943C",
+      "Location": "https://api.github.com/repos/hub4j-test-org/GHIssueTest/issues/18"
+    }
+  },
+  "uuid": "7894ed05-62de-4370-aaf5-aca3e6f55872",
+  "persistent": true,
+  "insertionIndex": 4
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/5-r_h_g_issues_18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/5-r_h_g_issues_18.json
new file mode 100644
index 000000000..7ba337c3e
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/5-r_h_g_issues_18.json
@@ -0,0 +1,54 @@
+{
+  "id": "2fed5af6-d201-4326-9f60-c78c3e312f19",
+  "name": "repos_hub4j-test-org_ghissuetest_issues_18",
+  "request": {
+    "url": "/repos/hub4j-test-org/GHIssueTest/issues/18",
+    "method": "GET",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    }
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "5-r_h_g_issues_18.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:49 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"38680077efa24b88949bd249310b7631040d580a6aa11fee565a6153792eedd8\"",
+      "Last-Modified": "Wed, 14 Feb 2024 10:21:48 GMT",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "repo",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4948",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "52",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "E5F8:32B29:3D26687:3DD2F83:65CC943D"
+    }
+  },
+  "uuid": "2fed5af6-d201-4326-9f60-c78c3e312f19",
+  "persistent": true,
+  "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-18",
+  "requiredScenarioState": "Started",
+  "newScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-18-2",
+  "insertionIndex": 5
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/6-r_h_g_issues_18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/6-r_h_g_issues_18.json
new file mode 100644
index 000000000..bd0688348
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/6-r_h_g_issues_18.json
@@ -0,0 +1,57 @@
+{
+  "id": "5d351cba-2a0a-4e33-9e6d-1e88b068bb75",
+  "name": "repos_hub4j-test-org_ghissuetest_issues_18",
+  "request": {
+    "url": "/repos/hub4j-test-org/GHIssueTest/issues/18",
+    "method": "PATCH",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    },
+    "bodyPatterns": [
+      {
+        "equalToJson": "{\"state_reason\":\"not_planned\",\"state\":\"closed\"}",
+        "ignoreArrayOrder": true,
+        "ignoreExtraElements": false
+      }
+    ]
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "6-r_h_g_issues_18.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:50 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"f2a2460cbd40da6fdb165ffe1524088d4ce97de67de5b90689ffdb68d96b70e5\"",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4947",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "53",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "E5FA:32B29:3D268B8:3DD31A6:65CC943D"
+    }
+  },
+  "uuid": "5d351cba-2a0a-4e33-9e6d-1e88b068bb75",
+  "persistent": true,
+  "insertionIndex": 6
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/7-r_h_ghissuetest.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/7-r_h_ghissuetest.json
new file mode 100644
index 000000000..bcf9d5e52
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/7-r_h_ghissuetest.json
@@ -0,0 +1,53 @@
+{
+  "id": "9b3cf8fe-1a59-483e-934a-29c33827f1a7",
+  "name": "repos_hub4j-test-org_ghissuetest",
+  "request": {
+    "url": "/repos/hub4j-test-org/GHIssueTest",
+    "method": "GET",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    }
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "7-r_h_ghissuetest.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:50 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"b2ac2191c1e9b1f08faeaaccb75edaddcb0a246463bc332277b765141bae9ead\"",
+      "Last-Modified": "Thu, 22 Sep 2022 09:33:16 GMT",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "repo",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4946",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "54",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "E604:32B29:3D26C7A:3DD3572:65CC943E"
+    }
+  },
+  "uuid": "9b3cf8fe-1a59-483e-934a-29c33827f1a7",
+  "persistent": true,
+  "scenarioName": "scenario-1-repos-hub4j-test-org-GHIssueTest",
+  "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHIssueTest-2",
+  "insertionIndex": 7
+}
\ No newline at end of file
diff --git a/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/8-r_h_g_issues_18.json b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/8-r_h_g_issues_18.json
new file mode 100644
index 000000000..372849845
--- /dev/null
+++ b/src/test/resources/org/kohsuke/github/GHIssueTest/wiremock/closeIssueNotPlanned/mappings/8-r_h_g_issues_18.json
@@ -0,0 +1,53 @@
+{
+  "id": "7e339749-6af0-4aa4-a986-e8a350143970",
+  "name": "repos_hub4j-test-org_ghissuetest_issues_18",
+  "request": {
+    "url": "/repos/hub4j-test-org/GHIssueTest/issues/18",
+    "method": "GET",
+    "headers": {
+      "Accept": {
+        "equalTo": "application/vnd.github.v3+json"
+      }
+    }
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "8-r_h_g_issues_18.json",
+    "headers": {
+      "Server": "GitHub.com",
+      "Date": "Wed, 14 Feb 2024 10:21:50 GMT",
+      "Content-Type": "application/json; charset=utf-8",
+      "Cache-Control": "private, max-age=60, s-maxage=60",
+      "Vary": [
+        "Accept, Authorization, Cookie, X-GitHub-OTP",
+        "Accept-Encoding, Accept, X-Requested-With"
+      ],
+      "ETag": "W/\"f2a2460cbd40da6fdb165ffe1524088d4ce97de67de5b90689ffdb68d96b70e5\"",
+      "Last-Modified": "Wed, 14 Feb 2024 10:21:50 GMT",
+      "X-OAuth-Scopes": "repo",
+      "X-Accepted-OAuth-Scopes": "repo",
+      "github-authentication-token-expiration": "2024-03-15 10:12:46 UTC",
+      "X-GitHub-Media-Type": "github.v3; format=json",
+      "x-github-api-version-selected": "2022-11-28",
+      "X-RateLimit-Limit": "5000",
+      "X-RateLimit-Remaining": "4945",
+      "X-RateLimit-Reset": "1707909241",
+      "X-RateLimit-Used": "55",
+      "X-RateLimit-Resource": "core",
+      "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
+      "Access-Control-Allow-Origin": "*",
+      "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
+      "X-Frame-Options": "deny",
+      "X-Content-Type-Options": "nosniff",
+      "X-XSS-Protection": "0",
+      "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
+      "Content-Security-Policy": "default-src 'none'",
+      "X-GitHub-Request-Id": "E60C:28AC70:3F850E9:403198B:65CC943E"
+    }
+  },
+  "uuid": "7e339749-6af0-4aa4-a986-e8a350143970",
+  "persistent": true,
+  "scenarioName": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-18",
+  "requiredScenarioState": "scenario-2-repos-hub4j-test-org-GHIssueTest-issues-18-2",
+  "insertionIndex": 8
+}
\ No newline at end of file