About autolinks
Anyone with admin permissions to a repository can configure autolink references to link issues, pull requests, commit messages, and release descriptions to external third-party services.
Autolink references can now accept alphanumeric characters. When originally introduced, custom autolinks were limited to external resources that used numeric identifiers. Custom autolinks now work with alphanumeric and numeric identifiers.
You define custom autolinks by specifying a reference prefix and a target URL.
- Reference prefixes cannot have overlapping names. For example, a repository cannot have two custom autolinks with prefixes such as
TICKET
andTICK
, since both prefixes would match the stringTICKET123a
. - Target URLs include a
<num>
variable which represents the reference identifier of the linked resource.
Configuring autolinks to reference external resources
This procedure demonstrates how to configure autolinks to reference external resources. For example, if you use Zendesk to track user-reported tickets, you can reference a ticket number in the pull request you opened to fix the issue.
-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the "Integrations" section of the sidebar, click Autolink references.
-
At the top right of the page, click Add autolink reference.
-
Select the format of the reference identifier used in the external resource, either Alphanumeric or Numeric.
-
Under "Reference prefix", type a short, meaningful prefix. Collaborators will use this text to generate autolinks for the external resource.
-
Under "Target URL", type the format of the link to the external system you want to create. Use the
<num>
variable as a placeholder for the reference identifier. -
Review the preview and verify that the autolink and external reference are both correct, then click Add autolink reference to define the link.
For example, you might enter the following.
- Reference prefix:
JIRA-
- Target URL:
https://jira.example.com/issue?query=<num>
- Preview:
JIRA-123
is converted tohttps://jira.example.com/issue?query=123