Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Schedule a build with Rest API

Elifcan Çakmak February 23, 2023

Hello all,

Is there a way to schedule a Bamboo build using Rest API? (Or other ways besides the interface schedule)

What I need is to start a build at a certain time and a certain day provided by me.

Thanks in advance,

Elifcan

1 answer

1 accepted

2 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2023

Hello @Elifcan Çakmak

There is no REST API endpoint that would allow you to book a build as the action queue action is immediate.

You can configure a Cron-Based Scheduled trigger using the UI, Java Specs or YAML Specs.

By using YAML Specs, the whole Plan configuration will have to be managed by YAML over Repository Stored Specs (RSS), including the Triggers. If using Java Specs, you can opt to use RSS just like YAML Specs or simply push the changes on demand to your plan using Maven.

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Elifcan Çakmak February 23, 2023

Hi @Eduardo Alvarenga 

Thanks for your answer. Can you give me an example of how I can use the queue action of Rest API with an environment variable?

I want to run a customized build with overriding a variable with Rest API. It says in the documentation "Additional variables could be passed to this method either as form encoded POST payload or query parameters" But I don't see an example in the documentation.

Thanks in advance,

Elifcan

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2023

Hello @Elifcan Çakmak 

Try this:

  • <Bamboo_URL>/rest/api/latest/queue/{projectKey}-{buildKey}?bamboo.variable.myVariable=valueForMyVariable

It is documented on this page:

Additional variables could be passed to this method either as form encoded POST payload or query parameters. PLEASE note: Query parameters are more important - override those stored in form payload. Variables defined in Bamboo as global variables or plan variables MUST be prefixed with bamboo.variable ie. bamboo.variable.myVariable=valueForMyVariable. When global or plan variables would be passed to this method, will override default values for variables.

Kind regards,

 

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events