Skip to content

Magiclink support for custom autolinked references #2549

@jklukas

Description

@jklukas

Description

It would be great for magiclink to give users the ability to configure auto-linking of additional references specific to their context. The biggest use case here would be for external ticketing systems like Jira or Zendesk.

Benefits

This would greatly expand the potential uses of magiclink since it lets users configure additional providers without magiclink having any specific support for that provider.

Solution Idea

GitHub allows this kind of configuration of custom "autolinked references". See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources

That interface strikes a nice balance between simplicity and customizability. It supports only patterns like <prefix><num> where the <prefix> is static and the <num> is a captured value (either numeric or alphanumeric) that can be injected into the output pattern.

We would add configuration that follows a similar pattern. Something like:

custom_refs:
  - identifier_type: numeric
    reference_prefix: JIRA-
    # Must include <num> to indicate where to inject the identifier
    target_url: 'https://jira.example.com/issue?query=<num>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions