You can open a new issue from a specific line or lines of code in a file or pull request.

When you open an issue from code, the issue contains a snippet showing the line or range of code you chose. You can only open an issue in the same repository where the code is stored.

Code snippet rendered in an issue opened from code

Any GitHub user can create an issue in a public repository where issues have not been disabled.

  1. On GitHub, navigate to the main page of the repository.

  2. Locate the code you want to reference in an issue:

    • To open an issue about code in a file, navigate to the file.
    • To open an issue about code in a pull request, navigate to the pull request and click Files changed. Then, browse to the file that contains the code you want include in your comment, and click View.
  3. Choose whether to select a single line or a range:

    • To select a single line of code, click the line number to highlight the line. File with a single line of code selected
    • To select a range of code, click the number of the first line in the range to highlight the line of code. Then, hover over the last line of the code range, press Shift, and click the line number to highlight the range. File with a range of code selected
  4. To the left of the code range, click . In the drop-down menu, click Open new issue.

    Kebab menu with option to open a new issue from a selected line

  5. Type a title and description for your issue. A sample issue

  6. If you're a project maintainer, you can assign the issue to someone, add it to a project board, associate it with a milestone, or apply a label.

  7. When you're finished, click Submit new issue.

Further reading