Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to create bitbucket repo during the transition of a workflow using Run CLI Actions in Jira.

...

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 executed based on your use case.

  1. Log in as a Jira Administrator.
  2. Navigate to the > Issues and under the Workflows tab, click the Edit link to modify the required workflow.
  3. Select the transition for which you want to add or edit the post function. Select the Post Functions option.
  4. Select CLI actions from the available options. Click Add.
    Image Modified
  5. Add the Bitbucket CLI action createRepository under Action field as shown in the below screenshot.
    CLI action:

    Code Block
    themeMidnight
     -a createRepository --server http://example.com/ --user xxxx --password xxxx --project "PROJ" --repository "test2-repo" --name "TFJ2-repo"


  6. Click Add and Publish the workflow.
  7. Create an issue. Now perform the transition on the issue to which post-function has been added. It will create 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.