Allow custom regex patterns for linking external issues #1507

Closed
opened 2025-11-02 04:03:07 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @tgdchmi2 on GitHub (Feb 7, 2018).

  • Gitea version (or commit ref): 1.3.2
  • Git version: 2.16.1
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

For external issue tracker: alphanumeric issue recognition does not work when:

  • Key before the dash contains a number. Example: BLG5-456
  • Key is enclosed in quotes. Example: 'BLG-456' or "BLG-456"
  • Key follows a slash: Example BLG-123/BLG-564 (first key is recognized, second one not)

We think implementing so many additional 'rules' could lead to many false positives.
Thus we propose to add a third External Issue Tracker Naming Style for specifying custom patterns to apply for matching issue keys. Then we could specify a pattern like (WP-\d+)|(BLG5-\d+) ourselves.
The matched group should then be used for replacing {index} in the External Issue Tracker URL Format.

Originally created by @tgdchmi2 on GitHub (Feb 7, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.3.2 - Git version: 2.16.1 - Operating system: Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ## Description For external issue tracker: alphanumeric issue recognition does not work when: - Key before the dash contains a number. Example: `BLG5-456` - Key is enclosed in quotes. Example: `'BLG-456'` or `"BLG-456"` - Key follows a slash: Example `BLG-123/BLG-564` (first key is recognized, second one not) We think implementing so many additional 'rules' could lead to many false positives. Thus we propose to add a third _External Issue Tracker Naming Style_ for specifying custom patterns to apply for matching issue keys. Then we could specify a pattern like `(WP-\d+)|(BLG5-\d+)` ourselves. The matched group should then be used for replacing `{index}` in the _External Issue Tracker URL Format_. <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/confirmedtype/featuretype/enhancement labels 2025-11-02 04:03:07 -06:00
Author
Owner

@stale[bot] commented on GitHub (Feb 8, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 8, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@strk commented on GitHub (May 30, 2019):

See also #7084 for an even more flexible mapping idea

@strk commented on GitHub (May 30, 2019): See also #7084 for an even more flexible mapping idea
Author
Owner

@jonny64 commented on GitHub (Nov 18, 2020):

Hi, we have tasks/{uuid v4} as issue {index}, what should we do?

@jonny64 commented on GitHub (Nov 18, 2020): Hi, we have tasks/{uuid v4} as issue {index}, what should we do?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1507