Bitbucket

The Bitbucket modules enable you to monitor repositories, users or teams, and create, update, retrieve, or delete issues, snippets or milestones in your Bitbucket account.

Getting Started with Bitbucket

Prerequisites

  • A Bitbucket account

In order to use Bitbucket with Make, it is necessary to have a Bitbucket account. If you do not have one, you can create a Bitbucket account at bitbucket.org/account/signup.

Note

The module dialog fields that are displayed in bold (in the Make scenario, not in this documentation article) are mandatory!

Connecting Bitbucket to Make

To connect your Bitbucket account to Make follow the general instructions for Connecting to services.

After you click the Continue button, Make will redirect you to the Bitbucket website where you will be prompted to grant Make access to your account.

61f267e30f9f7.png

Confirm the dialog by clicking the Grant Access button.

Watch

Triggers when specified events occur in the repository.

Required Permissions: webhook, repository, pullrequest, issue

Webhook name

Enter the name for the webhook. E.g. New Issue.

Connection

Establish a connection to your Bitbucket account.

Repository

Select the repository you want to watch for events.

Events

Choose the Bitbucket events that will trigger the module.

You can check that the webhook was created in the repository settings of your Bitbucket account.

61f267e453459.gif

Triggers when the specified event occurs in all repositories that belong to your account. Creates a new webhook for the specified user account.

Required Permissions: webhook, repository, pullrequest, issue

Note

One can only register webhooks on one's own account, not that of others.

Webhook name

Enter the name for the webhook. E.g. New Issue.

Connection

Establish a connection to your Bitbucket account.

Events

Choose Bitbucket events that will trigger the module.

Triggers when the specified event occurs in all repositories that belong to the selected team.

Required Permissions: webhook, repository, pullrequest, issue

Note

Only admins can install webhooks on teams.

Webhook name

Enter the name for the webhook. E.g. New Issue.

Connection

Establish a connection to your Bitbucket account.

Team

Select the team you want to monitor events for.

Events

Choose Bitbucket events that will trigger the module.

Issue

Creates a new issue.

Required Permissions: issue:write

Note

The authenticated user is used in the issue's reporter field in the issue's details (Bitbucket UI).

Warning

The issue tracker must be enabled to use this module. Please follow the instructions for Enable an issue tracker.

Note

The authenticated user must be the collaborator of the selected repository.

Connection

Establish a connection to your Bitbucket account.

Repository

Select the repository where you want to create a new issue.

Title

Enter the title of the issue.

Raw

Enter the description of the issue.

Markup

Select the markup language you want to use to format the issue description.

Kind

Select whether the issue is a bug, enhancement, proposal, or task.

Priority

Set the issue priority.

Username

Enter the user name of the user you want to assign the issue to.

The user name can be found in the user profile settings. https://bitbucket.org/account/user/{{username}}

61f267e76659d.png

State

Select the state of the issue.

Component

A component as defined in the repository's issue tracker.

Milestone

A milestone as defined in the repository's issue tracker.

Version

A version as defined in the repository's issue tracker.

Retrieves the details of an issue.

Required Permissions: issue

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository that contains the issue you want to retrieve.

Issue ID

Enter (map) or select the issue you want to retrieve details about.

Retrieves all issues within the selected repository.

Required Permissions: issue

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository you want to retrieve issues from.

Limit

Set the maximum number of issues Make will return during one execution cycle.

Updates the specified issue.

Required Permissions: issue:write

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository that contains the issue you want to update.

Issue ID

Enter (map) or select the issue you want to update.

Please find the descriptions of the fields in the Create an Issue section above.

Deletes a specified issue.

Required Permissions: issue:write

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository that contains the issue you want to delete.

Issue ID

Enter (map) or select the issue you want to delete.

Adds a comment to the issue.

Required Permissions: issue:write

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository that contains the issue you want to add a comment to.

Issue ID

Enter (map) or select the issue you want to add a comment to.

Raw

Enter the text content of the comment.

Markup

Specify the markup you want to use for formatting the comment.

Milestone

Retrieves all milestones within the specified repository.

Required Permissions: issue

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository you want to retrieve milestones from.

Limit

Set the maximum number of milestones Make will return during one execution cycle.

Retrieves milestone details.

Required Permissions: issue

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository that contains the milestone you want to retrieve.

Issue ID

Enter (map) or select the milestone you want to retrieve details about.

Returns a list of all the watchers of the specified repository.

Required Permissions: repository

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository you want to retrieve repository watchers from.

Limit

Set the maximum number of repository watchers Make will return during one execution cycle.

File

Downloads a file from the repository.

Required Permissions: repository

Connection

Establish a connection to your Bitbucket account.

Repository

Select or map the repository that contains the file you want to download.

File Name

Enter the file name of the file you want to download.

Snippet

Retrieves all snippets for the specified user.

Required Permissions: snippet

Connection

Establish a connection to your Bitbucket account.

User Name

Select or map the user name you want to retrieve snippets for.

Role

Select your role to filter returned snippets.

  • owner: all snippets owned by the current user

  • contributor: all snippets owned by, or watched by the current user

  • member: owned by the user, their teams, or watched by the current user

When no role is specified, all public snippets are returned, as well as all privately owned snippets watched or commented on.

Limit

Set the maximum number of snippets Make will return during one execution cycle.

Retrieves the details of a snippet.

Required Permissions: snippet

Connection

Establish a connection to your Bitbucket account.

User Name

Select or map the user or team name the snippet you want to retrieve belongs to.

Snippet ID

Enter (map) or select the ID of the snippet you want to retrieve details about.

Starts watching the specified snippet.

Required Permissions: snippet:write

Connection

Establish a connection to your Bitbucket account.

User Name

Select or map the user name associated with the snippet.

Role

Select your role for the snippet.

Snippet ID

Enter (map) or select the ID of the snippet you want to start watching.

Stops watching the specified snippet.

Required Permissions: snippet:write

Connection

Establish a connection to your Bitbucket account.

User Name

Select or map the user name associated with the snippet.

Role

Select your role for the snippet.

Snippet ID

Enter (map) or select the ID of the snippet you want to stop watching.

Retrieves all users that are watching a specified snippet.

Required Permissions: snippet

Connection

Establish a connection to your Bitbucket account.

Snippet ID

Enter (map) or select the ID of the snippet you want to retrieve users from.

Limit

Set the maximum number of users Make will return during one execution cycle.

Adds a comment to the specified snippet.

Required Permissions: snippet

Connection

Establish a connection to your Bitbucket account.

User Name

Select or map the user name.

Snippet ID

Enter (map) or select the snippet you want to add a comment to.

Raw

Enter the text content of the comment.

Markup

Specify the markup you want to use for formatting the comment.

Comment ID

If you want to post your comment as a reply, enter (map) the comment you want to reply to.

Make an API Call

Allows you to perform a custom API call.

Connection

Establish a connection to your Bitbucket account.

URL

Enter a path relative to https://api.bitbucket.org/2.0/. E.g. teams

For the list of available endpoints, refer to the Bitbucket API docs.

Method

Select the HTTP method you want to use:

GET

to retrieve information for an entry.

POST

to create a new entry.

PUT

to update/replace an existing entry.

PATCH

to make a partial entry update.

DELETE

to delete an entry.

Headers

Enter the desired request headers. You don't have to add authorization headers; we already did that for you.

Query String

Enter the request query string.

Body

Enter the body content for your API call.

Example of Use - List Teams

The following API call returns the list of all teams where your role is admin:

URL: teams

Query String

Key: roleValue: admin

61f267e896952.png

Matches of the search can be found in the module's Output under Bundle > Body > values.

In our example, 2 teams were returned:

61f267e99269c.png