How to find the Webhook to Jenkins for Bitbucket plugin configuration

Still need help?

The Atlassian Community is here for you.

Ask the community

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 and STA_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 and STA_SHARED_LOB via LOB_ID and retrieve only the LOB_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%';
DescriptionHow to find the Webhook to Jenkins for Bitbucket plugin configuration
ProductBitbucket

Last modified on Nov 9, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.