Currently, Bamboo is hardcoded to schedule branch expiry at 3am daily.
BranchExpiryScheduler.java
trigger = TriggerUtils.makeDailyTrigger(BRANCH_EXPIRY_TRIGGER, 3, 0);
In some cases, this might not be ideal as Bamboo is shut down during off office hours on costing reasons (EC2 hosting example).
Since builds expiry schedule is configurable, it would be a good idea to have branch expiry run together with build expiry.
Solution
Bamboo 5.15 introduces system property that allows to configure branch expiry trigger time:
/**
* Configure at what time should branch expiry run. Value should represent a valid time and is parsed using {@link java.time.format.DateTimeFormatter#ISO_LOCAL_TIME}
* <p>Usage: <pre>-Dbamboo.branch.expiry.schedule="04:56"</pre>
*/
public static final SystemProperty BRANCH_EXPIRY_SCHEDULED_TIME = new SystemProperty(false,
"bamboo.branch.expiry.schedule");