This article explains how to create a bitbucket repo during the transition of a workflow transition using Run CLI Actions in Jira app.
Instructions
Use createRepository action to create a Bitbucket repository. You need to add this CLI action in the workflow of the Jira where you want the action to get be executed based on your use case.
- Log in as a Jira Administrator.
- Navigate to the > Issues and under the Workflows tab, click the Edit link to modify the required workflow.
- Select the transition for which you want to add or edit the post function. Select the Post Functions option.
- Select CLI actionsaction from the available options. Click Add.
Add the Bitbucket CLI action, createRepository, under Action field as shown in the below screenshot.:
CLI action:Code Block theme Midnight -a createRepository --server http://example.com/ --user xxxx --password xxxx --project "PROJ" --repository "test2-repo" --name "TFJ2-repo"
- Click Add and Publish the workflow.
- Create an issue. Now perform the transition on the issue to which post-function has been added. It will create creates the repository in the Bitbucket.
The parameters used with the action are:
- --server value refers to the URL of the Bitbucket instance.
- --user value refers to the Bitbucket username.
- --password value refers to the Bitbucket password.
- --project value refers to the Bitbucket project.
- --repository value refers to the repository name.
Info |
---|
It is recommended to test this scenario in a test environment before deploying it in production. |