Creating a Bitbucket Server and Data Center project or repository from Jira
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The Bitbucket Data Center (and Server) to JIRA integration only has a feature to create a new branch from the Development panel in a Jira issue.
Sample screenshot from a JIRA issue
The integration does not provide a native way to create a new Bitbucket project or repository from Jira.
Solution
To be able to create a new Bitbucket project or repository from JIRA, Bitbucket REST APIs can be called from JIRA webhooks or from third-party plugins, such as Automation for Jira and ScriptRunner for Jira.
The Bitbucket REST APIs to call are:
- POST /rest/api/1.0/projects - to create a new project
- POST /rest/api/1.0/projects/{projectKey}/repos - to create a new repository for the given
projectKey