This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2020-05-23. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Article version: Enterprise Server 2.17

Opening an issue from code

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 Enterprise user can create an issue in a public repository where issues have not been disabled.

  1. On GitHub Enterprise, 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 Reference in 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

Ask a human

Can't find what you're looking for?

Contact us