MySQL - Repository Polling - Scheduled (v5.7-)
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Product | Version | Database | Documentation reference |
---|---|---|---|
Bamboo | V5.7.X | MySQL | Polling the repository for changes |
Lets find out how to get Bamboo's repository polling scheduled values from MySQL database along with updating those values.
Get repository polling as Scheduled
/*
* Bamboo version: 5.7-
* Database: MySQL
* Triggers: 'Repository polling' > 'Polling strategy' > 'Scheduled'
*/
select B.FULL_KEY as PLAN_KEY,
B.TITLE as TITLE,
VL.PLUGIN_KEY as REPOSITORY_TYPE,
ExtractValue(BD.XML_DEFINITION_DATA,
'//buildStrategies/buildStrategy/key[text()="poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="CRON"]/../../item/key[text()="repository.change.poll.cronExpression"]/../value'
) as SCHEDULED,
BD.BUILD_DEFINITION_ID as BUILD_DEFINITION_ID
from VCS_LOCATION as VL
join PLAN_VCS_LOCATION as PVL on PVL.VCS_LOCATION_ID = VL.VCS_LOCATION_ID
join BUILD as B on PVL.PLAN_ID = B.BUILD_ID
join BUILD_DEFINITION as BD on B.BUILD_ID = BD.BUILD_ID
where B.SUSPENDED_FROM_BUILDING = false
order by SCHEDULED desc, PLAN_KEY, TITLE;
What expect from query above:
PLAN_KEY | TITLE | SCHEDULED | BUILD_DEFINITION_ID |
---|---|---|---|
REP-GIT | Git | 0 0 12 ? * * | 425985 |
REP-SUB | Subversion | 0 0 13 ? * * | 451238 |