Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger a pipeline via the API modifing a variable

Gabriele Papi-Jobs March 22, 2025

Hi , I have a plan that I want to start via the API . Using the same approach of the "Run Custumized" via the UI , I would like to overrite a variable at start . 
How can I do this ? I use Bamboo Datacenter 

 

Best regards

1 answer

1 accepted

2 votes
Answer accepted
Gabriele Papi-Jobs March 22, 2025

solved by myself 

Using something like 

 

id='IDPROJ-IDPLAN'
bamboo_Password='MYTOKEN'
And convert the variable to a one adapt to the url using JQ (i'm on bash)
body_newvar=$(jq -n --argjson data ..allTheDataHere.. 
'$data' | jq -sRr @URI)7
And then using my CURL request
curl --location "$bamboo_URL/queue/$id?bamboo.variable.MYVAR=$body_newvar" \
--header "Authorization: Bearer $bamboo_Password" \
--header 'Content-Type: application/json' \
-k -X POST

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events