Skip to end of banner
Go to start of banner

How to create Bitbucket repository during a workflow transition using Run CLI Actions in Jira app.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Current »

This article explains how to create a Bitbucket repository during 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 Jira where you want the action to be executed. 

  1. Log in as a Jira Administrator.
  2. Navigate to the > Issues and click Custom fields.
  3. Click Add Custom field to create two custom fields of type Text field to add the Bitbucket repository and project to the specific screens. 
  4. Under the Workflows tab, click the Edit link to modify the concerned workflow.
  5. Select the transition for which you want to add or edit the post function. Select the Post Functions option.
  6. Select CLI action from the available options. Click Add.

  7. Add the 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:

     -a createRepository --server http://example.com/ --user xxxx --password xxxx --project "%original_customfield_xxxx%" --repository "%original_customfield_xxxxx%"



  8. Click Add and Publish the workflow.
  9. Create an issue and enter the value of the Bitbucket Repository and project name in the custom field.

  10. Perform the transition on the issue to which post-function has been added. It creates the repository in Bitbucket if Repository does not 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.
  • No labels