ByteChef LogoByteChef
Components

Bitbucket

Elevate your software delivery from planning to production and beyond, with built-in AI, CI/CD, and a best-in-class Jira integration.

Categories: Project Management

Type: bitbucket/v1


Connections

Version: 1

API Key Authorization

Properties

NameLabelTypeDescriptionRequired
usernameUsernameSTRINGEmail address of your Bitbucket account.true
passwordAPI KeySTRINGAPI key creation steps in documentation.true

Actions

Create Repository

Name: createRepository

Creates a repository in a selected workspace.

Properties

NameLabelTypeDescriptionRequired
workspaceWorkspaceSTRINGWorkspace in which repository will be created.true
repo_slugRepository SlugSTRINGRepository slug that is used as identifier for the repository.true
nameNameSTRINGThe name of the repository.true
scmSource Control Management.STRING
Options git
Specifies the version control system that your repository will use.true
projectProjectOBJECT
Properties {STRING(key)}
Parent project of the repository.true
is_privateIs PrivateBOOLEAN
Options true, false
Whether the repository is private or not.false
descriptionDescriptionSTRINGThe description of repository.false
fork_policyFork PolicySTRING
Options allow_forks, no_public_forks, no_forks
Specifies the fork policy for the repository.false
languageLanguageSTRINGMain programming language of the repositoryfalse

Example JSON Structure

{
  "label" : "Create Repository",
  "name" : "createRepository",
  "parameters" : {
    "workspace" : "",
    "repo_slug" : "",
    "name" : "",
    "scm" : "",
    "project" : {
      "key" : ""
    },
    "is_private" : false,
    "description" : "",
    "fork_policy" : "",
    "language" : ""
  },
  "type" : "bitbucket/v1/createRepository"
}

Output

Type: OBJECT

Properties

NameTypeDescription
typeSTRINGThe type of the object (usually "repository").
linksOBJECT
Properties {{STRING(href), STRING(name)}(self), {STRING(href), STRING(name)}(html), {STRING(href), STRING(name)}(avatar), {STRING(href), STRING(name)}(pullrequests), {STRING(href), STRING(name)}(commits), {STRING(href), STRING(name)}(forks), {STRING(href), STRING(name)}(watchers), {STRING(href), STRING(name)}(downloads), [{STRING(href), STRING(name)}](clone), {STRING(href), STRING(name)}(hooks)}
A collection of relevant resource links.
uuidSTRINGThe globally unique identifier for the repository.
full_nameSTRINGThe full name of the repository (workspace/repo_slug).
is_privateBOOLEAN
Options true, false
Indicates whether the repository is private.
scmSTRINGThe source control system (only "git" is supported).
ownerOBJECT
Properties {STRING(type)}
The user or team that owns the repository.
nameSTRINGThe display name of the repository.
descriptionSTRINGA short description of the repository.
created_onSTRINGTimestamp of when the repository was created.
updated_onSTRINGTimestamp of the last repository update.
sizeINTEGERTotal size of the repository in bytes.
languageSTRINGThe primary programming language of the repository.
has_issuesBOOLEAN
Options true, false
Indicates whether the issue tracker is enabled.
has_wikiBOOLEAN
Options true, false
Indicates whether the wiki is enabled.
fork_policySTRINGRepository fork policy.
projectOBJECT
Properties {STRING(type)}
Project that the repository belongs to.
mainbranchOBJECT
Properties {STRING(type)}
The default branch of the repository.

Output Example

{
  "type" : "",
  "links" : {
    "self" : {
      "href" : "",
      "name" : ""
    },
    "html" : {
      "href" : "",
      "name" : ""
    },
    "avatar" : {
      "href" : "",
      "name" : ""
    },
    "pullrequests" : {
      "href" : "",
      "name" : ""
    },
    "commits" : {
      "href" : "",
      "name" : ""
    },
    "forks" : {
      "href" : "",
      "name" : ""
    },
    "watchers" : {
      "href" : "",
      "name" : ""
    },
    "downloads" : {
      "href" : "",
      "name" : ""
    },
    "clone" : [ {
      "href" : "",
      "name" : ""
    } ],
    "hooks" : {
      "href" : "",
      "name" : ""
    }
  },
  "uuid" : "",
  "full_name" : "",
  "is_private" : false,
  "scm" : "",
  "owner" : {
    "type" : ""
  },
  "name" : "",
  "description" : "",
  "created_on" : "",
  "updated_on" : "",
  "size" : 1,
  "language" : "",
  "has_issues" : false,
  "has_wiki" : false,
  "fork_policy" : "",
  "project" : {
    "type" : ""
  },
  "mainbranch" : {
    "type" : ""
  }
}

Create Project

Name: createProject

Creates a project in selected workspace.

Properties

NameLabelTypeDescriptionRequired
workspaceWorkspaceSTRINGWorkspace where the project will be added.true
nameNameSTRINGThe name of the project.true
keyKeySTRINGKey of the project (eg. AT, for a project named Atlassian). Project keys must start with a letter and may only consist of ASCII letters, numbers and underscores (A-Z, a-z, 0-9, _).true
descriptionDescriptionSTRINGThe description of project.false
is_privateIs PrivateBOOLEAN
Options true, false
Whether the project is private or not.false

Example JSON Structure

{
  "label" : "Create Project",
  "name" : "createProject",
  "parameters" : {
    "workspace" : "",
    "name" : "",
    "key" : "",
    "description" : "",
    "is_private" : false
  },
  "type" : "bitbucket/v1/createProject"
}

Output

Type: OBJECT

Properties

NameTypeDescription
metricsOBJECT
Properties {INTEGER(org_keywords)}

Output Example

{
  "metrics" : {
    "org_keywords" : 1
  }
}

List Projects

Name: listProjects

Returns list of projects from workspace.

Properties

NameLabelTypeDescriptionRequired
workspaceWorkspaceSTRINGWorkspace from which projects are to be listed.true

Example JSON Structure

{
  "label" : "List Projects",
  "name" : "listProjects",
  "parameters" : {
    "workspace" : ""
  },
  "type" : "bitbucket/v1/listProjects"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
typeSTRINGThe type of the object (typically 'project').
linksOBJECT
Properties {{STRING(href), STRING(name)}(html), {STRING(href), STRING(name)}(avatar)}
Relevant links for the project.
uuidSTRINGGlobally unique identifier for the project.
keySTRINGUnique key identifying the project within the workspace.
ownerOBJECT
Properties {STRING(type)}
The workspace or user who owns the project.
nameSTRINGHuman-readable name of the project.
descriptionSTRINGDescription of the project.
is_privateBOOLEAN
Options true, false
Indicates whether the project is private.
created_onDATE_TIMETimestamp of when the project was created.
updated_onDATE_TIMETimestamp of the last update to the project.
has_publicly_visible_reposBOOLEAN
Options true, false
Indicates if the project contains any public repositories.

Output Example

[ {
  "type" : "",
  "links" : {
    "html" : {
      "href" : "",
      "name" : ""
    },
    "avatar" : {
      "href" : "",
      "name" : ""
    }
  },
  "uuid" : "",
  "key" : "",
  "owner" : {
    "type" : ""
  },
  "name" : "",
  "description" : "",
  "is_private" : false,
  "created_on" : "2021-01-01T00:00:00",
  "updated_on" : "2021-01-01T00:00:00",
  "has_publicly_visible_repos" : false
} ]

List Repositories

Name: listRepositories

Returns list of repositories from workspace.

Properties

NameLabelTypeDescriptionRequired
workspaceWorkspaceSTRINGWorkspace from which repositories are to be listed.true

Example JSON Structure

{
  "label" : "List Repositories",
  "name" : "listRepositories",
  "parameters" : {
    "workspace" : ""
  },
  "type" : "bitbucket/v1/listRepositories"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
typeSTRINGThe type of the object (usually "repository").
linksOBJECT
Properties {{STRING(href), STRING(name)}(self), {STRING(href), STRING(name)}(html), {STRING(href), STRING(name)}(avatar), {STRING(href), STRING(name)}(pullrequests), {STRING(href), STRING(name)}(commits), {STRING(href), STRING(name)}(forks), {STRING(href), STRING(name)}(watchers), {STRING(href), STRING(name)}(downloads), [{STRING(href), STRING(name)}](clone), {STRING(href), STRING(name)}(hooks)}
A collection of relevant resource links.
uuidSTRINGThe globally unique identifier for the repository.
full_nameSTRINGThe full name of the repository (workspace/repo_slug).
is_privateBOOLEAN
Options true, false
Indicates whether the repository is private.
scmSTRINGThe source control system (only "git" is supported).
ownerOBJECT
Properties {STRING(type)}
The user or team that owns the repository.
nameSTRINGThe display name of the repository.
descriptionSTRINGA short description of the repository.
created_onSTRINGTimestamp of when the repository was created.
updated_onSTRINGTimestamp of the last repository update.
sizeINTEGERTotal size of the repository in bytes.
languageSTRINGThe primary programming language of the repository.
has_issuesBOOLEAN
Options true, false
Indicates whether the issue tracker is enabled.
has_wikiBOOLEAN
Options true, false
Indicates whether the wiki is enabled.
fork_policySTRINGRepository fork policy.
projectOBJECT
Properties {STRING(type)}
Project that the repository belongs to.
mainbranchOBJECT
Properties {STRING(type)}
The default branch of the repository.

Output Example

[ {
  "type" : "",
  "links" : {
    "self" : {
      "href" : "",
      "name" : ""
    },
    "html" : {
      "href" : "",
      "name" : ""
    },
    "avatar" : {
      "href" : "",
      "name" : ""
    },
    "pullrequests" : {
      "href" : "",
      "name" : ""
    },
    "commits" : {
      "href" : "",
      "name" : ""
    },
    "forks" : {
      "href" : "",
      "name" : ""
    },
    "watchers" : {
      "href" : "",
      "name" : ""
    },
    "downloads" : {
      "href" : "",
      "name" : ""
    },
    "clone" : [ {
      "href" : "",
      "name" : ""
    } ],
    "hooks" : {
      "href" : "",
      "name" : ""
    }
  },
  "uuid" : "",
  "full_name" : "",
  "is_private" : false,
  "scm" : "",
  "owner" : {
    "type" : ""
  },
  "name" : "",
  "description" : "",
  "created_on" : "",
  "updated_on" : "",
  "size" : 1,
  "language" : "",
  "has_issues" : false,
  "has_wiki" : false,
  "fork_policy" : "",
  "project" : {
    "type" : ""
  },
  "mainbranch" : {
    "type" : ""
  }
} ]

Triggers

Repository Push

Name: repositoryPush

Triggers whenever a repository push occurs.

Type: DYNAMIC_WEBHOOK

Properties

NameLabelTypeDescriptionRequired
workspaceWorkspaceSTRINGWorkspace where the repository is located.true
repositoryRepositorySTRING
Depends On workspace
Repository that will be connected to the trigger.true

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "Repository Push",
  "name" : "repositoryPush",
  "parameters" : {
    "workspace" : "",
    "repository" : ""
  },
  "type" : "bitbucket/v1/repositoryPush"
}


Additional instructions


Connection Setup

Bitbucket API Token Creation

  1. Go to the Bitbucket website.
  2. Click Settings.
  3. Click Atlassian account settings.
  4. Click Security.
  5. Click Create and manage API tokens.
  6. Click Create API token with scopes.
  7. Enter name of your API token.
  8. Choose expiry date of your API token.
  9. Click Next.
  10. Select Bitbucket.
  11. Click Next.
  12. Find and select these scopes:
  • admin:project:bitbucket
  • admin:repository:bitbucket
  • read:project:bitbucket
  • read:repository:bitbucket
  • read:user:bitbucket
  • read:webhook:bitbucket
  • read:workspace:bitbucket
  • write:webhook:bitbucket
  1. After you have selected scopes click Next.
  2. Click Create token.
  3. Click on Copy. Make sure to save your newly created API token because after this step you won’t be able to view it again.
  4. Click Close.