Programmatically rerun only failed/incomplete jobs in Bamboo plugin task

When a build doesn’t complete it’s possible to manually run only the failed/incomplete jobs. I’d like to know if/how this can be done programmatically.

I’ve figured out how to programmatically finish a build in a task via the BuildExecutionManager. I’d like to be able to then rerun the failed/incomplete jobs of this finished build afterwards.

Using the BuildQueueManager’s addToQueue method seems promising but I can’t figure out how to obtain a CommonContext that would result in running only the failed/incomplete jobs. I’ve looked into this documentation which led me to looking into using a BuildContextBuilder, but the constructor requires a lot of parameters that I’m currently unsure of how to obtain.

I’ve also looked into using the rest api but I’d like to avoid this route if possible.

1 Like