> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# issues_add_sub_issue

> Attach an existing issue to this one as a sub-issue. `sub_issue_id` is the issue's `id` field, not the number shown in its URL — the two are different integers. Set `replace_parent` to move an issue that already has a parent.

<div className="tool-route"><span className="tool-row-method" data-method="POST">POST</span><code>{"https://api.github.com/repos/{owner}/{repo}/issues/{issueNumber}/sub_issues"}</code></div>

```python github_issues_add_sub_issue.py theme={null}
from charter.packs import github

result = await github.issues_add_sub_issue.ainvoke({"owner": ..., "repo": ..., "issueNumber": ..., "subIssueId": ...})
```

<Note>
  Requires `repo`, `read:user`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                               | Type      | Description                                                                              |
  | ------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span>       | `string`  | The account owner of the repository. The name is not case sensitive.                     |
  | `repo` <span className="required" title="required">\*</span>        | `string`  | The name of the repository without the `.git` extension. The name is not case sensitive. |
  | `issueNumber` <span className="required" title="required">\*</span> | `integer` | The number that identifies the issue.                                                    |
</div>

## Body

<div className="reference-table">
  | Field                                                              | Type      | Description                                                                                                                                                                 |
  | ------------------------------------------------------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `subIssueId` <span className="required" title="required">\*</span> | `integer` | The id of the sub-issue to add — its `id` field, not the `#number` shown in GitHub's interface. The sub-issue must belong to the same repository owner as the parent issue. |
  | `replaceParent`                                                    | `boolean` | When true, moves the sub-issue here from whatever parent it has now. Absent, an issue that already has a parent is refused.                                                 |
</div>
