How to find the Webhook to Jenkins for Bitbucket plugin configuration
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
Summary
If for some reason the Webhook to Jenkins for Bitbucket plugin becomes unavailable in the web interface, customers may want to back up its configuration before reinstalling the plugin.
This article explains where and how this data can be retrieved.
Webhook to Jenkins for Bitbucket is a paid plugin. For issues caused by this plugin, please submit a Support Request to Appfire.
Environment
Bitbucket Server/Data Center
Solution
- The app settings are stored in the database tables
STA_REPO_HOOK
andSTA_SHARED_LOB
. The following SQL query can be used for finding out the
LOB_ID
associated with that plugin:SELECT * FROM sta_repo_hook WHERE hook_key LIKE 'com.nerdwin15.stash-stash-webhook-jenkins%'; id repository_id hook_key is_enabled lob_id project_id -- ------------- ---------------------------------------------------------------- ---------- ------ ---------- 22 1 com.nerdwin15.stash-stash-webhook-jenkins:jenkinsPostReceiveHook true 122 (null)
Here we can see that
LOB_ID=122
, so we can run this SQL query as well in order to retrieve the plugin configuration:SELECT * FROM sta_shared_lob WHERE id = 122; id lob_data --- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 122 {"jenkinsBase":"http://jenkins.example.com","jenkinsEndPointType":"com.nerdwin15.stash.webhook.notifier.GitPluginNotifier","cloneType":"http","mirrorCloneUrl":"undefined","ignoreCerts":true,"omitHashCode":true,"omitBranchName":true,"omitTriggerBuildButton":true,"omitBuildsPage":true,"ignoreCommitters":"fkraemer","ignoreAccessKeys":"","branchOptions":"","branchOptionsBranches":"branch1","disabledEvents":"","urlParameters":""}
As can be seen, the
STA_SHARED_LOB
table is the one that really contains the app settings.A single SQL query can be used as well, by joining
STA_REPO_HOOK
andSTA_SHARED_LOB
viaLOB_ID
and retrieve only theLOB_DATA
column which is the one that really contains the plugin settings:SELECT lob_data FROM sta_shared_lob AS lob INNER JOIN sta_repo_hook AS hook ON lob.id = hook.lob_id WHERE hook.hook_key LIKE 'com.nerdwin15.stash-stash-webhook-jenkins%';