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
Community Members
Community Events
Community Groups

Update Pipeline Variable

I'm unable to successfully update a repository variable and not sure why it's not working.

I've been able to get all the necessary IDs and am making the following curl request:

curl -X PUT "{workspace}/{repository}/pipelines_config/variables/{variable_uuid}" -H 'Content-Type: application/json' -d '{"value":"{value}","key":"{name}"}'

from this I get:

{"type": "error", "error": {"message": "Resource not found"}}

Does anyone have any ideas what's missing as I've tried changing everything I can think of but with no luck

1 answer

0 votes
Caroline R Atlassian Team Aug 13, 2021

Hi, @Will Vachon! Welcome to the community! 

I tested this on my side and was able to update the repository variable using this curl request. These are the steps I have followed:

curl -X GET -u user_name:password{workspaceID}/{repository_name}/pipelines_config/variables/
curl -X PUT -u user_name:password "{workspaceID}/{repository_name}/pipelines_config/variables/%7B{variable_uuid}%7D" -H 'Content-Type: application/json' -d '{"value":"value_20","key":"key_20"}'

Could you please share the exact requests you have run to update your variables? With this information, I can further investigate what could be happening here.

Thank you! 

Kind regards,

Hey @Caroline R

So turns out I was missing the username:password auth and works fine with that, thanks!

Is this required or is there any other form or authenticating this, I'm wanting to set this up within a pipeline script & would be preferable if it wasn't linked to a specific user.

Like Caroline R likes this
Caroline R Atlassian Team Aug 16, 2021

Hey, @Will Vachon

I'm glad to know this is working fine now! :) 

Answering your question, API calls will always require a password to authenticate. 

Kind regards,

Suggest an answer

Log in or Sign up to answer
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,159 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