Connectors Reference

Bitbucket

Bitbucket is a web based hosting service for projects that use GIT revision control.

 

Status: Preview

Tier: Premium

Version: 1.0.0

 

Actions:

Name

Summary

DeleteHook (string account, string slug, string hookId)

Delete hook

ListComponents (string account, string slug)

List components

ListMilestones (string account, string slug)

List milestones

ListVersions (string account, string slug)

List versions

CreateIssue (string account, string slug, CreateIssueRequest body)

Create issue

GetIssueById (string account, string slug, string issueId)

Get issue by id

ListPullRequests (string account, string slug)

List pull requests

ApprovePullRequest (string account, string slug, string pullrequestId)

Approve pull request

DeclinePullRequest (string account, string slug, string pullrequestId)

Decline pull request

MergePullRequest (string account, string slug, string pullrequestId)

Merge pull request

ListRepositories (string account)

List repositories

GetUserById (string userId)

Get user by Id

 

Triggers:

Name

Summary

OnNewRepo (string account)

When a repository is added

CreateHookIssueCreated (string account, string slug, [Optional]WebhookRequest body)

When a new issue is added

CreateHookIssueUpdated (string account, string slug, [Optional]WebhookRequest body)

When an issue is updated

CreateHookPullRequestApproved (string account, string slug, [Optional]WebhookRequest body)

When a pull request is approved

CreateHookPullRequestCreated (string account, string slug, [Optional]WebhookRequest body)

When a pull request is created

CreateHookPullRequestDeclined (string account, string slug, [Optional]WebhookRequest body)

When a pull request is declined

CreateHookPullRequestMerged (string account, string slug, [Optional]WebhookRequest body)

When a pull request is merged

CreateHookRepositoryPush (string account, string slug, [Optional]WebhookRequest body)

When a new commit is pushed

 

Objects:

Name

Summary

ApprovePullRequestResponse

 

CreateIssueRequest

 

DeclineOrMergePullRequestResponse

 

IssueResponse

 

ListComponentMilestoneVersionResponse

 

List_pull_requests_Response

 

List_repositories_Response

 

UserResponse

 

WebhookRequest

 

 

Actions:

DeleteHook

Summary: Delete hook

Description: Delete a hook in a given repo.

 

Syntax:

Bitbucket.DeleteHook (string account, string slug, string hookId)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

hookId

string

 

 

True

 

Returns:

 

ListComponents

Summary: List components

Description: List components

 

Syntax:

Bitbucket.ListComponents (string account, string slug)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

 

Returns:

          Type:ListComponentMilestoneVersionResponse

 

ListMilestones

Summary: List milestones

Description: List milestones

 

Syntax:

Bitbucket.ListMilestones (string account, string slug)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

 

Returns:

          Type:ListComponentMilestoneVersionResponse

 

ListVersions

Summary: List versions

Description: List versions

 

Syntax:

Bitbucket.ListVersions (string account, string slug)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

 

Returns:

          Type:ListComponentMilestoneVersionResponse

 

CreateIssue

Summary: Create issue

Description: This operation creates a new issue in the given repository.

 

Syntax:

Bitbucket.CreateIssue (string account, string slug, CreateIssueRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

CreateIssueRequest

 

 

True

 

Returns:

          Type:IssueResponse

 

GetIssueById

Summary: Get issue by id

Description: This operation retrieves all information about the given issue.

 

Syntax:

Bitbucket.GetIssueById (string account, string slug, string issueId)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

issueId

string

(Issue Id)

The id of the issue.

True

 

Returns:

          Type:IssueResponse

 

ListPullRequests

Summary: List pull requests

Description: This operation returns a list of the last 100 pull requests for the given repo.

 

Syntax:

Bitbucket.ListPullRequests (string account, string slug)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

 

Returns:

          Type:List_pull_requests_Response

 

ApprovePullRequest

Summary: Approve pull request

Description: This operation is used to approve an existing pull request.

 

Syntax:

Bitbucket.ApprovePullRequest (string account, string slug, string pullrequestId)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

pullrequestId

string

(Pull Request Id)

The Id of the pull request.

True

ListPullRequests

 

Returns:

          Type:ApprovePullRequestResponse

 

DeclinePullRequest

Summary: Decline pull request

Description: This operation is used to decline an existing pull request.

 

Syntax:

Bitbucket.DeclinePullRequest (string account, string slug, string pullrequestId)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

pullrequestId

string

(Pull Request Id)

The Id of the pull request.

True

ListPullRequests

 

Returns:

          Type:DeclineOrMergePullRequestResponse

 

MergePullRequest

Summary: Merge pull request

Description: This operation can merge a given pull request.

 

Syntax:

Bitbucket.MergePullRequest (string account, string slug, string pullrequestId)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

pullrequestId

string

(Pull Request Id)

The Id of the pull request.

True

ListPullRequests

 

Returns:

          Type:DeclineOrMergePullRequestResponse

 

ListRepositories

Summary: List repositories

Description: This operation returns a list of all repositories in your account

 

Syntax:

Bitbucket.ListRepositories (string account)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

 

Returns:

          Type:List_repositories_Response

 

GetUserById

Summary: Get user by Id

Description: This operation returns all information about a given user by its id.

 

Syntax:

Bitbucket.GetUserById (string userId)

 

Parameters:

Name

Type

Summary

Required

Related Action

userId

string

(User Id)

The id of the user.

True

 

Returns:

          Type:UserResponse

 

Triggers:

Trigger OnNewRepo

Summary: When a repository is added

Description: Triggers when a new repository is created for the authenticated account.

 

Syntax:

Bitbucket.OnNewRepo (string account)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

 

Returns:

          Type:List_repositories_Response

 

Trigger CreateHookIssueCreated

Summary: When a new issue is added

Description: Triggers when a new issue is added to the given repository.

 

Syntax:

Bitbucket.CreateHookIssueCreated (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 

Trigger CreateHookIssueUpdated

Summary: When an issue is updated

Description: Triggers when an issue is updated in the given repository.

 

Syntax:

Bitbucket.CreateHookIssueUpdated (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 

Trigger CreateHookPullRequestApproved

Summary: When a pull request is approved

Description: Triggers when a pullreqest is approved in the specified repository.

 

Syntax:

Bitbucket.CreateHookPullRequestApproved (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 

Trigger CreateHookPullRequestCreated

Summary: When a pull request is created

Description: Triggers when a new pullreqest is created in the given repository.

 

Syntax:

Bitbucket.CreateHookPullRequestCreated (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 

Trigger CreateHookPullRequestDeclined

Summary: When a pull request is declined

Description: Triggers when an existing pullreqest is declined in the given repository.

 

Syntax:

Bitbucket.CreateHookPullRequestDeclined (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 

Trigger CreateHookPullRequestMerged

Summary: When a pull request is merged

Description: Triggers when an existing pullreqest is merged in the given repository.

 

Syntax:

Bitbucket.CreateHookPullRequestMerged (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 

Trigger CreateHookRepositoryPush

Summary: When a new commit is pushed

Description: Triggers when a new commit is pushed to the given repository.

 

Syntax:

Bitbucket.CreateHookRepositoryPush (string account, string slug, [Optional]WebhookRequest body)

 

Parameters:

Name

Type

Summary

Required

Related Action

account

string

(Account Name)

Atlassian account or team name

True

slug

string

(Repository Id)

Bitbucket repository

True

ListRepositories

body

WebhookRequest

 

 

False

 

Returns:

          Type:string

 


 

ApprovePullRequestResponse

Summary:

Description:

 

          Properties:

Name

Type

Summary

role

string

Role

The role of the pull request.

type

string

Type

The type of the pull request.

user

User

Approver

user

approved

boolean

Is approved

True if the pull request is approved.

 

User

Summary: Approver

Description: user

 

          Properties:

Name

Type

Summary

username

string

Username

The username of the approver.

display_name

string

Name

The display name of the approver.

type

string

Type

User or team.

uuid

string

UUID

The universally unique identifier of the user.

 


 

CreateIssueRequest

Summary:

Description:

 

          Properties:

Name

Type

Summary

title

string

Issue Title

 

content

Content

 

The description of the issue.

kind

string

Issue Type

Values: [bug, enhancement, proposal, task]

priority

string

Priority

The priority category of the issue.  Values: [trivial, minor, major, critical, blocker]

status

string

Status

Values: [new, open, resolved, on hold, invalid, duplicate, wontfix]

component

Component

 

 

milestone

Milestone

 

 

version

Version

 

 

 

Content

Summary:

Description: The description of the issue.

 

          Properties:

Name

Type

Summary

raw

string

Description

 

markup

string

markup

markup

 

Component

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

Component

Pre-defined component value.

 

Milestone

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

Milestone

Pre-defined milestone value.

 

Version

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

Version

Pre-defined version value.

 


 

DeclineOrMergePullRequestResponse

Summary:

Description:

 

          Properties:

Name

Type

Summary

merge_commit

Merge_commit

merge_commit

merge_commit

description

string

Description

Pull request description.

title

string

Title

Pull request title.

destination

Destination

Destination

Destination branch.

state

string

Status

Pull request status.

closed_by

Closed_by

 

 

source

Source

Source

 

author

Author

Author

Author

created_on

string(date-time)

Created Date-Time

yyyy-MM-ddTHH:mm:ss.fff(+hh:mm or -hh:mm)

reason

string

Reason

The reason the pull request is declined (if so).

updated_on

string

Updated on

yyyy-MM-ddTHH:mm:ss.fff(+hh:mm or -hh:mm)

id

integer(int32)

Id

The Id of the pull request.

task_count

integer(int32)

Task Count

Task count.

 

Merge_commit

Summary: merge_commit

Description: merge_commit

 

          Properties:

Name

Type

Summary

hash

string

hash

hash

 

Destination

Summary: Destination

Description: Destination branch.

 

          Properties:

Name

Type

Summary

branch

Branch

Branch

branch

commit

Commit

Commit

 

repository

Repository

Repository

 

 

Branch

Summary: Branch

Description: branch

 

          Properties:

Name

Type

Summary

name

string

Name

The name of the destination branch.

 

Commit

Summary: Commit

Description:

 

          Properties:

Name

Type

Summary

hash

string

Hash

The SHA1 of the destination branch head.

 

Repository

Summary: Repository

Description:

 

          Properties:

Name

Type

Summary

name

string

Name

The name of the destination branch repository.

uuid

string

UUID

The UUID of the destination branch repository.

type

string

Type

The type of the destination branch repository.

 

Closed_by

Summary:

Description:

 

          Properties:

Name

Type

Summary

username

string

Closed By Username

Username of person who closed the PR.

display_name

string

Closed By Name

Name of person who closed the PR.

type

string

User Type

Closed by a user or team.

uuid

string

UUID

Unique identifier of person who closed the PR.

 

Source

Summary: Source

Description:

 

          Properties:

Name

Type

Summary

branch

Branch

Branch

 

commit

Commit

Commit

Commit

repository

Repository

Repository

Repository

 

Branch

Summary: Branch

Description:

 

          Properties:

Name

Type

Summary

name

string

Name

Name of the source branch.

 

Commit

Summary: Commit

Description: Commit

 

          Properties:

Name

Type

Summary

hash

string

Hash

The SHA1 of the source branch head.

 

Repository

Summary: Repository

Description: Repository

 

          Properties:

Name

Type

Summary

name

string

Name

The name of the source branch repository.

uuid

string

UUID

The UUID of the source branch repository.

type

string

Type

The type of the source branch repository.

 

Author

Summary: Author

Description: Author

 

          Properties:

Name

Type

Summary

display_name

string

Name

The display name of the creator.

type

string

Type

The type of the creator.

username

string

Username

The username of the creator

uuid

string

UUID

The universally unique identifier of the creator.

 


 

IssueResponse

Summary:

Description:

 

          Properties:

Name

Type

Summary

priority

string

Priority

The priority of the issue.

kind

string

Kind

The kind of issue.

repository

Repository

Repository

 

reporter

Reporter

Reporter

 

title

string

Title

The title of the issue.

component

Component

 

 

votes

integer(int32)

Votes

The number of votes on the issue.

watches

integer(int32)

Watches

The number of watches on the issue.

content

Content

Description

 

assignee

string

Assignee

The assigned user of the issue.

state

string

Status

The status of the issue.

version

Version

 

 

created_on

string(date-time)

Created on

yyyy-MM-ddTHH:mm:ss.fff(+hh:mm or -hh:mm)

milestone

Milestone

 

 

updated_on

string(date-time)

Updated on

yyyy-MM-ddTHH:mm:ss.fff(+hh:mm or -hh:mm)

type

string

Type

The type of issue.

id

integer(int32)

Issue Id

The Id of the issue.

 

Repository

Summary: Repository

Description:

 

          Properties:

Name

Type

Summary

type

string

type

The type of the repository.

name

string

name

The name of the repository.

full_name

string

full name

The full name of the repository.

uuid

string

UUID

The Universally Unique Identifier of the repository.

 

Reporter

Summary: Reporter

Description:

 

          Properties:

Name

Type

Summary

username

string

Username

The username of the reporter.

display_name

string

Display name

The display name of the reporter.

type

string

Type

The type of the reporter.

uuid

string

UUID

The Universally Unique Identifier of the reporter.

 

Component

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

Component

Pre-defined component value.

 

Content

Summary: Description

Description:

 

          Properties:

Name

Type

Summary

raw

string

text

The description of the issue.

markup

string

markup

The description markup of the issue.

html

string

html

The description html of the issue.

 

Version

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

Version

A version value defined by the administrator.

 

Milestone

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

Milestone

Pre-defined milestone value.

 


 

ListComponentMilestoneVersionResponse

Summary:

Description:

 

          Properties:

Name

Type

Summary

values

array of (ValuesItem)

values

values

 

ValuesItem

Summary:

Description:

 

          Properties:

Name

Type

Summary

name

string

name

name

 


 

List_pull_requests_Response

Summary:

Description:

 

          Properties:

Name

Type

Summary

values

array of (ValuesItem)

PR

values

 

ValuesItem

Summary:

Description:

 

          Properties:

Name

Type

Summary

title

string

Title

Title of the pull request.

id

integer(int32)

Id

Id of the pull request.

 


 

List_repositories_Response

Summary:

Description:

 

          Properties:

Name

Type

Summary

values

array of (ValuesItem)

values

values

 

ValuesItem

Summary:

Description:

 

          Properties:

Name

Type

Summary

scm

string

SCM

Source control manager for the repository.

website

string

Website

Url of the website if defined.

has_wiki

boolean

Has Wiki

True if the repository has a wiki.

name

string

Name

Repository's name.

fork_policy

string

Fork Policy

Allow forks, no public forks or no forks.

uuid

string

UUID

Repository's immutable id.

language

string

Language

Programming language used in the repository.

created_on

string(date-time)

Created Date-Time

yyyy-MM-ddTHH:mm:ss.fff(+hh:mm or -hh:mm)

has_issues

boolean

Has Issue Tracker

True if an issue tracker has been set for the repository.

owner

Owner

Owner

owner

updated_on

string(date-time)

Updated Date-Time

yyyy-MM-ddTHH:mm:ss.fff(+hh:mm or -hh:mm)

size

integer(int32)

Size

Integer indicating size of the repository in bytes.

type

string

Type

Git or mercurial.

slug

string

Slug

Slug used to identify the repository.

is_private

boolean

Is private

True if the repository is private.

description

string

Description

The repository's description.

 

Owner

Summary: Owner

Description: owner

 

          Properties:

Name

Type

Summary

username

string

Username

Username of the repository's owner.

display_name

string

Name

Display name of the repository's owner.

uuid

string

UUID

Unique identifier of the repository's owner.

 


 

UserResponse

Summary:

Description:

 

          Properties:

Name

Type

Summary

username

string

Username

The username.

type

string

Type

The user type.

display_name

string

Display Name

The display name of the user.

uuid

string

UUID

The universally unique identifier of the user.


 

WebhookRequest

Summary:

Description:

 

          Properties:

Name

Type

Summary

description

string

Description

A description of the webhook being created.

url

string

url

url

active

boolean

active

active

events

array of (string)

events

events