Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Adding variables to REST API using curl

I have created a small script to trigger a pipeline using the test API 

I am trying to run this script with the ref_name and pattern as arguments to the script master deploy 


curl -X POST -is -u $BB_USER:$BB_PASS \
-H 'Content-Type: application/json' \ \
-d '
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "$1",
"selector": {
"type": "custom",
"pattern": "$2"

Tried few ways to take the arguments into the script but I get an error as below 

{"error": {"message": "Not found", "detail": "Could not find last reference for branch $1", "data": {"key": "result-service.pipeline.reference-not-found", "arguments": {"uuid": "$1"}}}}

I want to add this as a part of pipeline 

thanks a lot for your help in advance 

1 answer

0 votes

Hello @Roopesh ,

In your case, you can use pipe trigger-pipeline.

Just add the following snippet to the script section of your bitbucket-pipelines.yml file:

  - pipe: atlassian/trigger-pipeline:3.1.0
      REPOSITORY: 'your-awesome-repo'
      BRANCH_NAME: 'master'
      CUSTOM_PIPELINE_NAME: 'deployment-pipeline'

More available pipes you can discover here.


cool , thank you Alex 

I'm trying to get this to work. I have a question regarding the `BITBUCKET_APP_PASSWORD`. Am I supposed to actually have the line


Or am should I replace  `$BITBUCKET_APP_PASSWORD` with the app password I created?

With the app password explicitly in the yml file it works, the way you posted it it doesn't.

BITBUCKET_APP_PASSWORD:- null value not allowed

I'm not sure it's a good idea to have the app password in the file explicitly.

Suggest an answer

Log in or Sign up to answer
Community showcase

All you wanted to know about customer support KPIs

When working in customer support, it’s crucial to calculate, analyze and monitor specific numbers, called KPIs (Key Performance Indicators). They go hand-in-hand with customer satisfaction, problem d...

66 views 1 4
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