Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,911
Community Members
 
Community Events
165
Community Groups

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

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): bitbucket.org:443

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

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

DEBUG: https://api.bitbucket.org:443 "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


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

 

Thanks
Abdul

 

1 answer

1 accepted

1 vote
Answer accepted
Patrik S Atlassian Team Jun 20, 2022

Hello @Abdul Rehman ,

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  : 

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

Thank you, @Abdul Rehman .

Kind regards,

Patrik S

@Patrik S 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
Thanks
My issue Solved with your Answer @Patrik S 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,263 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you