Versions Compared

Key

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

This article explains how to create a Bitbucket repository during a workflow transition using the Run CLI Actions in Jira app.

Instructions

Use createRepository action to create a Bitbucket repository. You need to add Add this CLI action in action in the relevant Jira workflow of Jira where you want the action is to be executed

  1. Log in as in as a Jira Administratoradministrator.
  2. Navigate to the to Image Modified> Issues and click Custom click Custom fields.
  3. Click Add Custom field to create two custom fields of typeText field, to add the Bitbucket repository and project to the specific screens. 
  4. Under the Workflows tab, click the Edit link to Click Edit to modify the concerned workflow under the Workflows tab.
  5. Select the transition for which you want to add to be added or edit the post function. Select , and then select the Post Functions option.
  6. Select CLI action from the available options . Click and click Add.
    Image RemovedImage Added
  7. Add the Bitbucket the createRepository Bitbucket CLI action , createRepository, under Action field as shown in the below screenshot: Here, replace the server, user,  password and enter the custom field substitution variables for the parameter project and repository.CLI action:

    Code Block
    themeMidnight
     -a createRepository --server http://example.com/ --user xxxx --password xxxx --project "%original_customfield_xxxx%" --repository "%original_customfield_xxxxx%"
    Image Removed


    Here, replace the server, user, and password parameters, and enter the custom field substitution variables for the project and repository parameters.
    Image Added
  8. Click Add and Publish the workflow.
  9. Create an issue, and enter the value of the Bitbucket Repository repository and project name in the custom field.
    Image Modified
  10. Perform the transition on the issue to which post-function has been added. It creates the repository in Bitbucket if Repository the repository does not already exist.

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