Branch mappings

Creates a branch mapping

post/projects/{projectKey}/repos/{repositorySlug}/branch-mappings

Path parameters

projectKeystring required
repositorySlugstring required

Request body

branchFromstring

The branch name you want to branch from when a new branch is created for the chosen JIRA project and issue type.

branchNameStrategy'BRANCH_TYPE' | 'FLEXIBLE_BRANCH_NAME'

The strategy to use for building branch names. Either BRANCH_TYPE or FLEXIBLE_BRANCH_NAME

branchNameTemplatestring

Variables you can use: $issueKey, $fixVersion, $component, $issueSummary, $parentIssueKey. Example: $component/$fixVersion/$issueType/$issueKey-$issueSummary resulting in backend/1.0/bugfix/BRANCHWIZ-12-flexible-branch-strategy

branchType'FEATURE' | 'RELEASE' | 'CUSTOM' | 'HOTFIX' | 'BUGFIX'

The branch type you want to use for the chosen JIRA project and issue type.

customBranchPrefixstring

The prefix for custom branches, e.g. 'security-fixes'. The plug-in will append the JIRA issue key to the branch name, resulting in branch names like 'security-fixes/MYPROJ-123-CSRF-problem'.

duplicationsstring

List of repositories that use the same branch mappings as this one.

idinteger

ID of the branch mapping. Only necessary when updating a mapping.

jiraComponentIdinteger

The JIRA component for this branch mapping. This allows you to assign different repositories for different components of the same JIRA project.

jiraIssueTypeIdinteger

The JIRA issue type ID for this branch mapping. Whenever a branch is created from this JIRA project and issue type, the chosen branch type and branch from values below are filled in by the plug-in.

jiraProjectKeystring

The JIRA project key that belongs to this repository. You can have multiple mappings with different JIRA projects for the same repository.

overrideBranchFromboolean

true if you want to override the branch from value (otherwise, the default branch for the repository is taken).

removeJiraIssueSummaryboolean

By default Bitbucket adds the JIRA issue key and the summary to the branch name. If you enable this option, only the JIRA issue key will be used.

Response

Branch mapping created

branchFromstring

The branch name you want to branch from when a new branch is created for the chosen JIRA project and issue type.

branchNameStrategy'BRANCH_TYPE' | 'FLEXIBLE_BRANCH_NAME'

The strategy to use for building branch names. Either BRANCH_TYPE or FLEXIBLE_BRANCH_NAME

branchNameTemplatestring

Variables you can use: $issueKey, $fixVersion, $component, $issueSummary, $parentIssueKey. Example: $component/$fixVersion/$issueType/$issueKey-$issueSummary resulting in backend/1.0/bugfix/BRANCHWIZ-12-flexible-branch-strategy

branchType'FEATURE' | 'RELEASE' | 'CUSTOM' | 'HOTFIX' | 'BUGFIX'

The branch type you want to use for the chosen JIRA project and issue type.

customBranchPrefixstring

The prefix for custom branches, e.g. 'security-fixes'. The plug-in will append the JIRA issue key to the branch name, resulting in branch names like 'security-fixes/MYPROJ-123-CSRF-problem'.

duplicationsstring

List of repositories that use the same branch mappings as this one.

idinteger

ID of the branch mapping. Only necessary when updating a mapping.

jiraComponentIdinteger

The JIRA component for this branch mapping. This allows you to assign different repositories for different components of the same JIRA project.

jiraIssueTypeIdinteger

The JIRA issue type ID for this branch mapping. Whenever a branch is created from this JIRA project and issue type, the chosen branch type and branch from values below are filled in by the plug-in.

jiraProjectKeystring

The JIRA project key that belongs to this repository. You can have multiple mappings with different JIRA projects for the same repository.

overrideBranchFromboolean

true if you want to override the branch from value (otherwise, the default branch for the repository is taken).

removeJiraIssueSummaryboolean

By default Bitbucket adds the JIRA issue key and the summary to the branch name. If you enable this option, only the JIRA issue key will be used.