Skip to content

Add gh issue support for parent issues / sub-tasks #10298

Closed

Description

@premun

Describe the feature or problem you’d like to solve

It is currently not possible to set a parent issue/sub-task when creating/editing issues:
https://docs.github.com/en/issues/planning-and-tracking-with-projects/understanding-fields/about-parent-issue-and-sub-issue-progress-fields

Proposed solution

I think it would be enough to add these options: --set-parent [ID] and --unset-parent [ID].

Additional context

Activity

  1. changed the title [-]Ass `gh issue` support for specifying a parent issue (or sub-task)[/-] [+]Add `gh issue` support for specifying a parent issue (or sub-task)[/+] on Jan 23, 2025
  2. changed the title [-]Add `gh issue` support for specifying a parent issue (or sub-task)[/-] [+]Add `gh issue` support for parent issues / sub-tasks[/+] on Jan 23, 2025
  3. added
    enhancementa request to improve CLI
    gh-issuerelating to the gh issue command
    needs-productAn issue that requires prioritization considerations
    on Jan 27, 2025
  4. jtmcg commented on Jan 27, 2025

    @jtmcg
    Contributor

    Hey @premun, thanks for the request! We are currently chatting internally about how we want to approach this. We'll try to provide an update when we have one 🙂

  5. aRustyDev commented on May 10, 2025

    @aRustyDev

    Has there been any movement on this? I would love to be able to start leveraging this for my projects.

  6. BagToad commented on May 10, 2025

    @BagToad
    Member

    @aRustyDev Not yet because we've had some competing priorities. I also think there might be more to fully supporting sub-issues than this - like issue view probably needs to be updated as well.

    However, if you are comfortable sharing more information about your CLI specific use cases, we can make sure that feedback is heard in our prioritization discussions and taken into account when we start working on this from a design standpoint.

  7. DhruvDh commented on May 17, 2025

    @DhruvDh

    Hi, tools like the just released OpenAI Codex (the cloud product) are very good at tackling small tasks autonomously. It would be a huge productivity boost to be able to use Codex to break down high-effort issues into smaller sub-issues and conveniently track progress.

    You can configure the Codex environment and AGENTS.md to use gh CLI...

  8. aRustyDev commented on May 29, 2025

    @aRustyDev

    @aRustyDev Not yet because we've had some competing priorities. I also think there might be more to fully supporting sub-issues than this - like issue view probably needs to be updated as well.

    However, if you are comfortable sharing more information about your CLI specific use cases, we can make sure that feedback is heard in our prioritization discussions and taken into account when we start working on this from a design standpoint.

    My use case is similar to @DhruvDh

    I'm trying to be able to automate breaking up bigger issues, as well as trying to make some repos declarative in nature. I have some template repositories that I want to be able to quickly deploy a set of simple issues on creation (manually via the CLI if need be). Think like having a template for a rust repo, but needing to change out a few things depending if the repo is intended for a desktop app vs a web app vs a cli executable etc. So I might need to add configuration for homebrew cask or remove a dockerfile or something simple, but these would all roll up under one parent issue ("cleanup repo" or something).

    This would help alot with documenting what I'm doing, quickly building out a list of small changes that need to be verified and helping to keep my issues cleaner.

  9. yahsan2 commented on Jun 30, 2025

    @yahsan2

    Hi! I've implemented a working gh issue add-sub command for my personal use since the GraphQL addSubIssue mutation is now available.

    Implementation details:

    • Command: gh issue add-sub <parent-issue> <sub-issue>
    • Supports issue numbers and URLs
    • Works with --repo flag
    • Includes proper error handling and tests
    • Follows existing gh CLI patterns and conventions

    Example usage:

    # Basic usage
    gh issue add-sub 123 456
    
    # With URLs
    gh issue add-sub https://github.com/owner/repo/issues/123 456
    
    # Cross-repository
    gh issue add-sub 123 456 --repo owner/repo

    Live demo:

    I've successfully tested it on my fork repository:

    • Repository: https://github.com/yahsan2/gh-cli
    • Created parent issue "Test Parent Issue" (#1)
    • Created sub-issue "Test Sub Issue" (#2)
    • Linked them with: gh issue add-sub 1 2 --repo yahsan2/gh-cli
    • Result: ✓ Added issue #2 as a sub-issue of #1

    Source code:

    The implementation is available in my fork: yahsan2@05f9f44ab

    Files added:

    • pkg/cmd/issue/addsub/addsub.go - Main command implementation
    • pkg/cmd/issue/addsub/addsub_test.go - Unit tests
    • pkg/cmd/issue/issue.go - Integration with existing issue commands

    The implementation is fully functional and ready to use. If there's interest from the maintainers and community, I'd be happy to create a PR for review and discussion.

  10. AzulGarza commented on Jul 4, 2025

    @AzulGarza

    it would be very cool to see the subissues in gh issue view.:)

  11. 8 remaining items

  12. Riprock commented on Aug 1, 2025

    @Riprock

    Is A PR gonna get opened to have this added?

  13. BagToad commented on Aug 1, 2025

    @BagToad
    Member

    Hi folks 👋

    Apologies for the silence on this one. This #10298 (comment) is still the current state of things.

    Huge thank you to @yahsan2 for the implementation reference. We haven't had the time to dig into it fully, but I know that'll be valuable in the future 🙏

    Like @stanoddly mentioned, porting your code to an extension could be a worthwhile endeavor, if you're interested. Extensions can help bridge the gap in these situations where we haven't been able to prioritize getting it into the core gh yet, while demonstrating the real world value and use of the feature 💡

    For everyone that is waiting for this, please:

    • React (👍 ) to the original issue post.
    • Describe your use cases and the value of this feature. Seeing the value and use-cases are incredibly important to our prioritization process.
  14. yahsan2 commented on Aug 7, 2025

    @yahsan2

    Thanks for the replies, you guys. @stanoddly @BagToad
    I didn't know gh extensions. I'll try to make an extension like gh-sub-issues. I’ll let you know if I can get it done.

  15. yahsan2 commented on Aug 7, 2025

    @yahsan2

    Describe your use cases and the value of this feature. Seeing the value and use-cases are incredibly important to our prioritization process.

    And in my case, I manage my tasks using GitHub Issues. I often start by breaking down tasks using Claude Code and documenting them. Based on that document, I frequently want to add sub-issues.

    If a sub-issues command existed, I could create structured issues directly from Claude Code outputs. Without parent-child issue relationships, the issue list becomes cluttered with many small tasks. By registering these as sub-issues under a single parent, I can keep the implementation units small while maintaining visibility and better progress tracking.

    In addition, some tasks can be completed via GitHub Actions. After breaking down the tasks, I want to clearly separate which ones I will implement manually and which can be completed automatically by GitHub Actions.

  16. yahsan2 commented on Aug 7, 2025

    @yahsan2

    I’ve already started implementing this :). For example, I would like to register the sections “Setup Tasks,” “Implementation Tasks,” and “Completion Checklist” from this issue comment as sub-issues:

    yahsan2/gh-sub-issues#4 (comment)

    I’m trying to use GraphQL with LLM prompts to register sub-tasks automatically, but I often encounter errors like “command not found” and the process is unstable.

    I believe using a proper CLI extension would make the instructions more reliable. However, it would be even better if sub-issue support were built into the official GitHub CLI.

  17. yahsan2 commented on Aug 7, 2025

    @yahsan2

    I’ve created a gh-sub-issue extension — feel free to try it out and let me know your feedback! and please star ⭐
    https://github.com/yahsan2/gh-sub-issue

    gh extension install yahsan2/gh-sub-issue

  18. adamrefactored commented on Aug 26, 2025

    @adamrefactored

    For my use case, I am using the GitHub CLI along with sub-issues to break down complex issues, ensuring that sub-agents remain focused and on task. However, I encountered a failure point when I asked an agent to create a new sub-issue using the CLI, and it became completely confused. In my search for documentation to assist with this, I found the resources to be limited, which is how I ended up here.

  19. sandcastle commented on Aug 27, 2025

    @sandcastle

    My primary use case is workflows with agents that breaking down PRD's into sub-issues for features/tasks.

    @aRustyDev Not yet because we've had some competing priorities. I also think there might be more to fully supporting sub-issues than this - like issue view probably needs to be updated as well.

    @BagToad - Even if adding/removing sub issues was to be added a ahead of solving future the issue view enhancements it would be a big win.

    In the mean time I'm using @yahsan2's extension https://github.com/yahsan2/gh-sub-issue

  20. dfaivre-pcs commented on Sep 5, 2025

    @dfaivre-pcs

    @aRustyDev Not yet because we've had some competing priorities. I also think there might be more to fully supporting sub-issues than this - like issue view probably needs to be updated as well.

    However, if you are comfortable sharing more information about your CLI specific use cases, we can make sure that feedback is heard in our prioritization discussions and taken into account when we start working on this from a design standpoint.

    I'd like to be able to query an issue ID and in its response have its Relationships data - highest priority being parent issue

  21. removed
    pitchpitched internally for prioritisation
    on Mar 24, 2026
  22. BagToad commented on Apr 8, 2026

    @BagToad
    Member

    Sub-issue support is in progress, covering --parent on create, --set-parent/--remove-parent on edit, and parent/subIssues/subIssuesSummary in --json output. The full design is up for review at #13120. If you have feedback on the proposed flags or behavior, please comment there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-issuerelating to the gh issue commandneeds-productAn issue that requires prioritization considerations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions