Example of how to create scheduled trigger plugin?

Hi,

After getting a great example about writing a Trigger (thanks @achystoprudov Alexey Chystoprudov) I am looking for advice, examples etc to write a scheduled Trigger.

Any help is greatly appreciated.

Thanks in advance,

Jaguar

What functionality of Bamboo scheduled trigger do you miss?

Hi Alexey,

When adding a scheduled trigger or a daily build trigger you can add a time (with a widget or a text box) for the trigger to be triggered.

I would like to know how to add that functionality to the trigger I am working on -based on the one you wrote :slight_smile:. : To be able to set a schedule for it to be triggered.

Thank you in advance for any guidance.

Jaguar

Look at Bamboo source code. There’s quartz job created for trigger which is scheduled for defined interval.

Hi Alexey

Thank you for your response.

The only place where I see a scheduler being created is in the PlanSpec.java file, but this code as I understand, does create a plan via code which will contain a scheduled trigger.

Just to make sure that I explain what I would like to achieve: I want to write a trigger that, after it is uploaded and installed, when configured, allows the user to choose a time/date for executing, pretty much like the Cron/Daily triggers shipped with Bamboo.

I’d be absolutely grateful.

Thank you very much in advance.

Jaguar

As a Bamboo user you have access to Bamboo source code. Look details at answer https://community.atlassian.com/t5/Bamboo-questions/Bamboo-source-code-download/qaq-p/674987
Then look at com.atlassian.bamboo.trigger.quartz.QuartzTriggerJob and com.atlassian.bamboo.v2.trigger.ScheduledBuildDetectionAction

1 Like