As per the reference for Bitbucket hyperlinking to source code, the url template is as follows.
{+bitbucket}{/owner, repository_name}/src{/commitish}{/filepath}{?fileviewer}{#fileline}
The mandatory field owner is referred to as 'The account owner the repository that contains the target file'. I've tried the admin user of the repository, however this does not work. Is the owner field here the repository admin user or a different user?
The bitbucket version in use is v4.14.3
Hi Prameesha,
The documentation you linked to is actually for Bitbucket Cloud, hosted at bitbucket.org. For Bitbucket Server, the URL structure is similar, but slightly different.
If the repository is part of a project, use the following structure:
If the repository is under a user, use the following structure:
Hi Jeff,
This works perfectly. However this always points to the source in the master branch. If I were to access the source in the develop branch how should I go about it?
Thanks,
Prameesha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prameesha,
After the <FILE_NAME>, you can add "?at=<BRANCH> to specify the branch you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff,
I used the following but this does not give me any results. It just shows me the entire source file but not the corresponding line.
https://bitbucket.company.com/projects/<PROJECT>/repos/<REPO_NAME>/browse/<FILE_PATH>/<FILE_NAME>#<Line number.>?at=<branch>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prameesha,
The Community site truncated the URL, which made it a bit hard to read. The ?at=<BRANCH> should come before the line number. For example:
...projects/<PROJECT>/repos/<REPO_NAME>/browse/<FILE_PATH>/<FILE_NAME>?at=<BRANCH>#<LINE_NUMBER>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any short way to point to current branch or current pull request, rather than mentioning the whole URL? Maybe something like
%File:F123T12%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prameesha, a repo can have several admins but that doesnt mean all of them are owners. The owner will be the creator of the repository. You can find who's the owner by navigating to the repo settings and clicking on User and group access.
Best regards,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ana,
I tried the same, however it gives me a URL not found exception. Is there any other configuration that needs to be enabled?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.