Include Bitbucket for Confluence Cloud provides 6 macros
to access files and more from Bitbucket Cloud and Data Center and include them into a Confluence Cloud page.
To add one of the Bitbucket Cloud macros for Confluence Cloud to a page:
In the Confluence editor, choose Insert > Other Macros.
Find and select the required macro ("External Content" category).
Speeding up macro input with auto-complete: Type /Bitbucket or /Include to see a list of suggested macros.
To edit an existing macro: Click the macro placeholder and choose Edit. A macro dialog window will open, where you can edit the parameters of the Bitbucket Cloud macro.
1. Bitbucket File: Include Bitbucket file by url
BITBUCKET CLOUD or BITBUCKET DATA CENTER / SERVER
This macro allows the user to include a file from a Bitbucket DC/Server or Cloud repository in order to have an up-to-date version of it in a Confluence page.
Paste a Bitbucket file URL directly into the Confluence page editor.
Note: Copy the file URL from you browser and paste it into the URL field.
You can also export your files to PDF or Word
Alternatively, type /Include Bitbucket File and ENTER to specify the details of this macro like the url of the file, syntax highlighting, title and line numbers.
2. Bitbucket Pull Requests: Bitbucket Cloud Pull Requests
This macro shows pull requests for a Bitbucket Cloud repository.
Type /Include Bitbucket Pull Requests and ENTER to specify the details of this macro.
Example:
Per default, only all open pull requests are shown. A query can be added to specify the macro. Ensure you tab out of the search query to ensure that the data refreshes.
Examples:
See filtering syntax here: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering.
3. Bitbucket Commits: Bitbucket Cloud commits
This macro shows commits for a Bitbucket Cloud repository.
Type /Include Bitbucket Commits and ENTER to specify the details of this macro.
Example:
A query can be added to filter the commits by file or branch. Ensure you tab out of the search query to ensure that the data refreshes.
Examples:
See Bitbucket API documentation here: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-comment-id-get
4. Bitbucket Branches: Bitbucket Cloud branches
This macro shows branches for a Bitbucket Cloud repository.
Type /Include Bitbucket Branches and ENTER to specify the details of this macro.
Example:
A query can be added to filter the branches by name. Ensure you tab out of the search query to ensure that the data refreshes.
Examples:
See filtering syntax here: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering.
This macro displays git tags for a Bitbucket Cloud repository.
Type /Include Bitbucket Tags and ENTER to specify the details of this macro.
Example:
A query can be added to filter the tags by name. Ensure you tab out of the search query to ensure that the data refreshes.
Examples:
name="version"
name~"beta"
See filtering syntax here: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering .
6. Bitbucket Issues: Bitbucket Cloud open issues
This macro shows issues for a Bitbucket Cloud repository.
Type /Include Bitbucket Issues and ENTER to specify the details of this macro.
Example:
A query can be added to specify the macro. Ensure you tab out of the search query to ensure that the data refreshes.
See filtering syntax here: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering.
Examples:
Note: It is useful to copy/paste the team name and the repository name from the repository url