Support linking issues by pasting issue URL #2892
Service Desk opened 4 days ago

Summary

When adding an issue link via Select Existing, allow pasting a full issue URL (including cross-project URLs) so the target issue is resolved and linked.

Current behavior

The issue picker accepts:

  • Issue number / fuzzy text search in the current project
  • Cross-project references in the form project/path#<number-or-query> or <project-key>-<number-or-query>

It does not accept a full issue URL such as:

https://<host>/<project/path>/~issues/<number>

Pasting such a URL fails to resolve the issue, which is especially awkward for cross-project links where the URL is what users typically copy from the browser.

Expected behavior

When the user pastes an issue URL into the link picker:

  1. Parse the project path and issue number from the URL
  2. Resolve that issue (subject to permission / link query constraints)
  3. Select it for linking, same as if a reference or search hit had been chosen

Acceptance criteria

  •  Pasting a same-project issue URL into Select Existing resolves the issue
  •  Pasting a cross-project issue URL resolves the issue in the other project
  •  Invalid / non-issue URLs do not match spuriously; existing number/text/project#/KEY- input continues to work

Related question: #2891

  • Service Desk referenced from other issue 4 days ago
  • Robin Shen changed state to 'Closed' 4 days ago
    Previous Value Current Value
    Open
    Closed
  • Zak Siddiqui commented 4 days ago

    @robin Not sure why this was closed because this is definitely not working for me.

    image.png

    Even when I hit Enter for the link, it's not the pasted link that gets added, but rather the first item in the options list.

  • Robin Shen commented 4 days ago

    Just input DevOps/terraform#135 here. This is shown in the issue detail page at right side.

  • Robin Shen commented 4 days ago

    Nevertheless will add a description to make it more explicit.

  • Zak Siddiqui commented 4 days ago

    @robin Your suggestion might work perfectly for projects that are native to OneDev.

    However, when a project is imported I'm finding PRs that are being named using the short name and then a number that actually conflicts with the issue with the same number.

    I mean, I'm not sure if it's because my project is imported or if this is for all projects, but I suspect it 's because it's imported.

    Therefore, the only way for me to absolutely know that I've got the correct link is to copy it from the URL on the address bar.

  • Zak Siddiqui commented 4 days ago

    ... that actually conflicts ...

    Just to give you an example, right now I'm up to issues in the 700s. but I'm having PRs that are being created in the 80s.

    And both of them are sharing the same short names. Just today, PRs for LAM-80 and LAM-81 were created, which is confusing because I have imported issues that have the same number.

    (imported from GitLab)

  • Robin Shen commented 4 days ago

    Issues and PRs in OneDev are numbered independently. Issue can only link to issues, not PRs.

  • Robin Shen commented 4 days ago

    I think mixing them in same number space is actually confusing, as they are really different things (issues are requirements/specs, and PRs are implementations)

  • Robin Shen commented 4 days ago

    PS: when referencing PRs in markdown, one has to write pr #<number>

  • Zak Siddiqui commented 2 days ago

    @robin How do I reference a PR in a child project in Markdown?

    Would it be pr DevOps/terraform#135?

  • Zak Siddiqui changed state to 'Open' 2 days ago
    Previous Value Current Value
    Closed
    Open
  • OneDev commented 2 days ago

    On behalf of AI user "Service Desk": Failed to do the job, please open workspace OD-3 for details

  • Zak Siddiqui commented 2 days ago

    @servicedesk please try again

  • Service Desk commented 2 days ago

    @zaakiy Yes, that's correct. To reference a PR in a child project in Markdown, use:

    pr DevOps/terraform#135

    Or alternatively with the full phrase:

    pull request DevOps/terraform#135

    Both formats will create a link to the PR in the specified project.

  • Robin Shen changed state to 'Closed' 2 days ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Improvement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-2892
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover