Import a GitHub Issues backlog into OrgGen

By the OrgGen AI team

You paste the JSON output of `gh issue list` and OrgGen reads it without a language model: same file, same plan, every time. A ticket's identity comes from its URL, never its title — a replay converges, and a renamed ticket is updated rather than duplicated.

The command to run

OrgGen reads the JSON output of the GitHub CLI — gh v2.102.0 (cli/cli repository, read on 2026-10-10). Run it in the repository you want (or with `--repo`) and paste the result as is — without editing it, without summarizing it.

gh issue list --repo <owner>/<repo> --state all --limit 500 \
  --json number,title,body,state,stateReason,closedAt,url,labels,assignees,milestone,parent,blockedBy
Every issue in the repository, with everything OrgGen can read

The `parent` and `blockedBy` fields (the sub-issue hierarchy and the dependencies) exist in `--json` only from `gh` version 2.94.0. With an older version, the batch is imported flat, and the plan says so.

What each field becomes

In GitHubIn OrgGen
`url`the issue's identity: `owner/repo#number` — and the original link, shown on the task
`title`, `body`the task's title and body (a body that is too long is truncated with a visible marker, and the plan says so)
`state`, `closedAt`open → to do; closed → done, with `closedAt` as the completion date
`stateReason`an issue closed as "not planned" is done BUT labeled `not-planned`, so it cannot be mistaken for a completed issue
`labels`the task's labels (20 at most; the plan counts the ones beyond that)
`assignees`the assignees, by their `login` — matched to the project's people when they match
`milestone`a `milestone:<title>` label (this is not an OrgGen milestone: neither a due date nor a description is carried over)
`parent`the parent task
`blockedBy`the task's dependencies

Three levels in GitHub, two in OrgGen

GitHub sub-issues can nest several levels deep (Epic → Feature → task). OrgGen supports two levels: a parent task and its subtasks. An issue at the third level or deeper is therefore linked to the highest ancestor the batch knows, and its direct parent stays readable in a `parent:<ref>` label.

The steps, in order

  1. You run the command above and paste the output to your agent — OrgGen's chat, or an MCP client that sends an API key.
  2. The agent calls `import_tasks` with `format: "github-issues-json"` and your output in `text`. By default it is a dry run: the plan is returned (created, updated, skipped, conflicts, errors) and nothing is written.
  3. The agent is instructed to show you this plan. Read the errors first: a parent or blocker missing from the batch is named there, along with the issue it holds up.
  4. Nothing is written without a second, explicit call, with `dryRun: false` and the same batch. The agent keeps the `importId` that comes back.
  5. A doubt afterward: `list_imports` finds the batch, `rollback_import` rolls it back — as a dry run first.

Replay, update, roll back

  • Replaying never duplicates: the replay key is the issue URL. Running the command again and pasting the result again creates only the new issues.
  • A renamed issue is the same task. With `onExisting: "update"`, the import rewrites the supplied fields of an already imported task — only if nobody has changed it since; otherwise it comes out as a conflict, never overwritten.
  • Rolling back a batch deletes what it created and keeps what a human has modified. The updates it made are not restored.
  • A finished task keeps its completion date: it is the `closedAt` from GitHub.
  • More than 500 issues: several calls with the same `importId`, split BY TREE — a root issue and everything under it in the same call. The hierarchy is computed per call: a third-level issue imported after its parent, which was already imported under a different parent, is refused, by name.
  • A dependency on an issue from another call must already be imported: otherwise the issue is refused, by name, and replaying its call once the other call has been imported converges.
  • Tasks already imported through the OrgGen format under another key are not recognized: their issues would be created twice. Roll that batch back first (`rollback_import`).

What does not carry over

  • Issue comments (`comments`): a task has no place to hold them.
  • The author, the creation and update dates, reactions, pinning and GitHub project items: read if requested, never imported.
  • A milestone's due date and description: only its title becomes a label.
  • Child issues (`subIssues`, `subIssuesSummary`) and the inverse relation (`blocking`): the link is read from each issue's `parent` and `blockedBy`.
  • The issue type (`issueType`) and linked pull requests (`closedByPullRequestsReferences`).
  • A parent or blocker removed in GitHub since a previous import: OrgGen can set a link, not detach it.

For the current read, the plan returns the list of keys that were read but not imported (its `notes`), and the number of issues affected by each transformation (closed as "not planned", linked, labels truncated). A loss is never discovered after the fact.

Moving from another tool? See how to switch to OrgGen

Try it on your own case

Describe your situation in one sentence — OrgGen builds the diagram and runs the numbers.

Try it on your own case

← All guides