Run the trigger pipeline to trigger other repo pipeline in both Repo's owned by a team
Asked by Abdul Rehman:

I have tried all the above mentioned steps still I am getting this error

    Status: Downloaded newer image for bitbucketpipelines/trigger-pipeline:5.0.0

    DEBUG: Starting new HTTPS connection (1): http://bitbucket.org:443/

    DEBUG: https://bitbucket.org/ "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None

    DEBUG: Starting new HTTPS connection (1): http://api.bitbucket.org:443/

    DEBUG: https://api.bitbucket.org/ "POST /2.0/repositories/workspace-name/repo_name/pipelines/ HTTP/1.1" 404 61

    ? Account, repository or branch doesn't exist.

Bitbucket pipeline code in repo, from where I'm trying to trigger another repo in same TEAM workspace  

```
master:

      - step:

          name: Preparing Dependencies

          script:

            - pipe: atlassian/trigger-pipeline:5.0.0

              variables:

                BITBUCKET_USERNAME: $BITBUCKET_USERNAME

                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD

                REPOSITORY: '`repo_name`'

                ACCOUNT: '`workspace-name`' # Optional

                BRANCH_NAME: 'main' # Optional

                # REF_TYPE: '<string>' # Optional

                # REF_NAME: '<string>' # Optional

                # CUSTOM_PIPELINE_NAME: '<string>' # Optional

                # PIPELINE_VARIABLES: '<json>' # Optional

                WAIT: "true"

                # WAIT_MAX_TIMEOUT: '<string>' # Optional

                DEBUG: 'true' # Optional
```

I can confirm that the repo which I'm trying to get triggered, it's branch name is **++main++**   
And the branch from where I'm trying to trigger is **++master++**as clearly mentioned in the pipeline file above

++**Workspace Variables:**++   
BITBUCKET_USERNAME: $BITBUCKET_USERNAME  
This is my personal username

BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD  
This is also my personal app password which I created in my account setting   

I have admin access to the workspace of our team and I can merge pull commit in main branch of that repo

<br />

Please help me out if you need any additional details I'm willing to give you

Thanks  
Abdul


Answers:
author: Patrik S
body: Hello [@Abdul Rehman](/t5/user/viewprofilepage/user-id/4401291) ,

Thank you for reaching out to Atlassian Community!

The version 5.0.0 of the pipe **atlassian/trigger-pipeline** has decommissioned the variable BRANCH_NAME, so in this case you will need to remove that variable from your syntax and add the following ones to replace it :

```
REF_TYPE: '<string>' # The type of the reference to run the pipeline on. Can be branch or tag. Default branch.REF_NAME: '<string>' # The name of the reference to run the pipeline on. Default master. It should be a branch name if the REF_TYPE is branch, it should be a tag name if REF_TYPE is tag
```

With that in mind, your YML file to trigger a branch named **main**in another repository would look like below :

```
master:

      - step:
          name: Preparing Dependencies
          script:
            - pipe: atlassian/trigger-pipeline:5.0.0
              variables:
                BITBUCKET_USERNAME: $BITBUCKET_USERNAME
                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
                REPOSITORY: '`repo_name`'
                ACCOUNT: '`workspace-name`' 
                REF_TYPE: 'branch' 
                REF_NAME: 'main' 
                WAIT: "true"          
                DEBUG: 'true' # Optional
```

For more details about the available variables in the latest version of the pipe, you can refer to its official documentation :

* <https://bitbucket.org/atlassian/trigger-pipeline/src/master/>

Hope that helps! Let us know in case you run into any issues trying the suggestion above.

Thank you, [@Abdul Rehman](/t5/user/viewprofilepage/user-id/4401291) .

Kind regards,

Patrik S

comments: author: Abdul Rehman
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) Thank you so much for helping out really appreciated. You are right as I was using **atlassian/trigger-pipeline:5.0.0** it has difference variables syntax which I have found from here as well [Bitbucket trigger pipeline](https://bitbucket.org/product/features/pipelines/integrations?p=atlassian/trigger-pipeline.?)  
Thanks  
My issue Solved with your Answer [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

trigger