Child pages
  • Bitbucket (Stash) Notifier Plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View Stash Notifier on the plugin site for more information.


This plugin notifies an Atlassian Bitbucket (or Stash) instance of Jenkins builds in progress and of their results. The build results will show up in the commit or pull request list in Bitbucket/Stash and provide immediate and easy to scan feedback about a commit. It is possible to navigate from build result information in Bitbucket/Stash directly to the build in question. The plugin can be configured on a per-job basis, globally for all Jobs or both to minimize the configuration overhead.

7 Comments

  1. Could you add release notes please?

  2. I've problem if build is succesful it's still showing  the icon that build is in progress. But if build is failed then it show the correct icon (the red one).

    I'm using Bitbucket Server 5.8.1,  Stash Notifier Plugin 1.13 and Jenkins 2.104

    would really appreciate if you can help me to solve this.

     

    Thanks in advanced

  3. Hello Rudy Mu

    Could you help me that how did you do Bitbucket configuration ?

    I installed  Stash Notifier Plugin to Jenkins side but I haven't found anything about Bitbucket Server side configuration.

    Thanks.

  4. Actually it is standard configuration. I run this command in Jenkins Pipeline. It shows the correct icon if there is an error but if it succesful it just shows progress icon

    post {
    success {
    cleanWs()
    script {
    if (stringName != "others")
    {
    echo "success"
    notifyBitbucket commitSha1: '', considerUnstableAsSuccess: false, credentialsId: 'XX', disableInprogressNotification: true, ignoreUnverifiedSSLPeer: false, includeBuildNumberInKey: true, prependParentProjectKey: false, projectKey: '', stashServerBaseUrl: "${stashURL}"
    }
    }
    }

  5.  

    And in jenkins 

  6. I found the reason why. It is because currentBuild.result. Now it works fine

  7. Hi everybody. 

    I need your help regarding the usage of Bitbucket (Stash) Notifier Plugin inside my Jenkins items, with Jenkins SSH Global Credentials.

    I tried both these procedures to let the plugin working, without any success

    1) modify my Jenkinsfile for the pipeline job, at the end of the Build stage

    post {
    always {
    notifyBitbucket commitSha1: '', considerUnstableAsSuccess: false, credentialsId: $(THE_ID_FOR_SSH_JENKINS_CREDENTIALS'), disableInprogressNotification: false, ignoreUnverifiedSSLPeer: false, includeBuildNumberInKey: true, prependParentProjectKey: false, projectKey: '', stashServerBaseUrl: $(THE_BASE_URL_BEFORE_THE_PROJECT_FOLDER)
    }
    }

    2) modify my groovy file to generate Job DSL:

    pipelineJob("myJob")

    {

    publishers {
    stashNotifier {
    credentialsId($(THE_ID_FOR_SSH_JENKINS_CREDENTIALS')
    serverBaseUrl($(THE_BASE_URL_BEFORE_THE_PROJECT_FOLDER)
    }
    }

    }

    In the Console Output, I received this error

    [Pipeline] notifyBitbucket 
    Notifying Stash at $(THE_BASE_URL_BEFORE_THE_PROJECT_FOLDER)
    Failed to notify Stash for commit e24de87b6a124a5437d1087a2d7899d165738fc2 (<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, can&#39;t find that - HMC Stash</title><script>
    window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};window.WRM._unparsedErrors=window.WRM._unparsedErrors||{};
    WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\u0022\u005C/stash\u0022";
    WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:nps.survey.inline.dialog.data"]="true";
    WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:nps.experiment.enabled.by.sen.data"]="false";
    WRM._unparsedData["com.atlassian.analytics.analytics-client:policy-update-init.policy-update-data-provider"]="false";
    WRM._unparsedData["com.atlassian.analytics.analytics-client:programmatic-analytics-init.programmatic-analytics-data-provider"]="false";
    WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:user.time.zone.onboarding.data"]="true";
    if(window.WRM._dataArrived)window.WRM._dataArrived();</script>
    <link type="text/css" rel="stylesheet" href="/stash/s/4b6b1220aa70a0677e5338fc34d6fb7a-CDN/1929385064/cad3c23/16/1b615eee93091f36273c8450f7d72556/_/download/contextbatch/css/_super/batch.css" data-wrm-key="_super" data-wrm-batch-type="context" media="all">
    <link type="text/css" rel="stylesheet" href="/stash/s/a7fbf82db6550df967b76333137c5698-CDN/1929385064/cad3c23/16/3d495125bc3aed3f6b014093426d9f53/_/download/contextbatch/css/bitbucket.page.errors,bitbucket.layout.base,-_super/batch.css" data-wrm-key="bitbucket.page.errors,bitbucket.layout.base,-_super" data-wrm-batch-type="context" media="all">
    <link type="text/css" rel="stylesheet" href="/stash/s/60032d950bf3e16790b2ef6769eeb712-CDN/1929385064/cad3c23/16/338ece3b79eeb5c3a17fbe7e1154eaf2/_/download/contextbatch/css/atl.general,-_super/batch.css?analytics-enabled=true&amp;nps-acknowledged=true&amp;nps-enabled=true" data-wrm-key="atl.general,-_super" data-wrm-batch-type="context" media="all">
    <script type="text/javascript" src="/stash/s/ca10d54b5dd77839fc97a8c8c8676026-CDN/1929385064/cad3c23/16/1b615eee93091f36273c8450f7d72556/_/download/contextbatch/js/_super/batch.js?locale=en-US" data-wrm-key="_super" data-wrm-batch-type="context" data-initially-rendered></script>
    <script type="text/javascript" src="/stash/s/c0c09b21eb638889f148663814b8b960-CDN/1929385064/cad3c23/16/3d495125bc3aed3f6b014093426d9f53/_/download/contextbatch/js/bitbucket.page.errors,bitbucket.layout.base,-_super/batch.js?locale=en-US" data-wrm-key="bitbucket.page.errors,bitbucket.layout.base,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
    <script type="text/javascript" src="/stash/s/750b1aa3b478c1b52c7530ba35906511-CDN/1929385064/cad3c23/16/338ece3b79eeb5c3a17fbe7e1154eaf2/_/download/contextbatch/js/atl.general,-_super/batch.js?analytics-enabled=true&amp;locale=en-US&amp;nps-acknowledged=true&amp;nps-enabled=true" data-wrm-key="atl.general,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
    <meta name="application-name" content="Bitbucket"><link rel="shortcut icon" type="image/x-icon" href="/stash/s/1929385064/cad3c23/16/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-web:favicon/favicon.ico" /><link rel="search" href="https://hxgntech.com/stash/plugins/servlet/opensearch-descriptor" type="application/opensearchdescription+xml" title="Bitbucket code search" /></head><body class="aui-page-focused aui-page-focused-large aui-page-size-large bitbucket-theme bitbucket-errors"><ul id="assistive-skip-links" class="assistive"><li><a href="#content">Skip to content</a></li></ul><div id="page"><!-- start #header --><header id="header" role="banner"><section class="notifications"></section><nav class="aui-header aui-dropdown2-trigger-group" role="navigation"><div class="aui-header-inner"><div class="aui-header-before"><a class=" aui-dropdown2-trigger app-switcher-trigger" aria-controls="app-switcher" aria-haspopup="true" role="button" tabindex="0" data-aui-trigger href="#app-switcher"><span class="aui-icon aui-icon-small aui-iconfont-appswitcher">Linked Applications</span></a><div id="app-switcher" class="aui-dropdown2 aui-style-default" role="menu" aria-hidden="true" data-is-switcher="true" data-environment="{&quot;isUserAdmin&quot;:false,&quot;isAppSuggestionAvailable&quot;:false,&quot;isSiteAdminUser&quot;:false}"><div role="application"><div class="app-switcher-loading">Loading&hellip;</div></div></div></div><div class="aui-header-primary"><h1 id="logo" class="aui-header-logo aui-header-logo-bitbucket"><a href="https://hxgntech.com/stash" class="stash"><span class="aui-header-logo-device">Bitbucket</span></a></h1><ul class="aui-nav"><li class=" projects-link"><a href="/stash/projects" class="projects-link" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:projects-menu">Projects</a></li><li class=" public-repos-link"><a href="/stash/repos" class="public-repos-link" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:public-repositories-link">Repositories</a></li></ul></div><div class="aui-header-secondary"><ul class="aui-nav"><li><div id="quick-search-loader"></div><script>jQuery(document).ready(function () {require(['bitbucket/internal/component/quick-search/quick-search-loader'], function (loader) {loader.onReady('#quick-search-loader');});});</script></li><li class=" help-link"title="Help"><a class=" aui-dropdown2-trigger aui-dropdown2-trigger-arrowless" aria-controls="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" aria-haspopup="true" role="button" tabindex="0" data-aui-trigger><span class="aui-icon aui-icon-small aui-iconfont-help">Help</span><span class="icon aui-icon-dropdown"></span></a><div id="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" class="aui-dropdown2 aui-style-default" role="menu" aria-hidden="true"><div role="application"><div class="aui-dropdown2-section help-items-section"><ul class="aui-list-truncate" role="presentation"><li role="presentation"><a href="http://docs.atlassian.com/bitbucketserver/docs-056/Bitbucket+Server+documentation?utm_campaign=in-app-help&amp;amp;utm_medium=in-app-help&amp;amp;utm_source=stash" title="Go to the online documentation for Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:general-help">Online help</a></li><li role="presentation"><a href="https://www.atlassian.com/git?utm_campaign=learn-git&amp;utm_medium=in-app-help&amp;utm_source=stash" title="Learn about Git commands &amp; workflows" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:learn-git">Learn Git</a></li><li role="presentation"><a href="/stash/getting-started" class="getting-started-page-link" title="Overview of Bitbucket features" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:getting-started-page-help-link">Welcome to Bitbucket</a></li><li role="presentation"><a href="/stash/#" class="keyboard-shortcut-link" title="Discover keyboard shortcuts in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:keyboard-shortcuts-help-link">Keyboard shortcuts</a></li></ul></div></div></div></li><li class=" alerts-menu"title="View system alerts"><a href="#alerts" id="alerts-trigger" class="alerts-menu" title="View system alerts" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:global-alerts-menu-item">Alerts</a></li><li class="user-dropdown"><a id="login-link" href="/stash/login?next=/error404">Log In</a></li></ul></div></div> <!-- End .aui-header-inner --></nav> <!-- End .aui-header --></header><!-- End #header --><!-- Start #content --><section id="content" role="main" tabindex="-1" data-timezone="-120" ><div class="aui-page-panel content-body"><div class="aui-page-panel-inner"><div class="error-image _404"></div><h2>Oops, you&#39;ve found a dead link</h2><p>Use the links at the top to get back.</p></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- End #content --><!-- Start #footer --><footer id="footer" role="contentinfo"><section class="notifications"></section><section class="footer-body"><ul><li data-key="footer.license.message">Git repository management for enterprise teams powered by <a href="http://www.atlassian.com/software/bitbucket/">Atlassian Bitbucket</a></li></ul><ul><li>Atlassian Bitbucket <span title="cad3c234b2a10e12ec62c805d0d2d7179c86b8e0" id="product-version" data-commitid="cad3c234b2a10e12ec62c805d0d2d7179c86b8e0" data-system-build-number="cad3c23"> v5.6.6</span></li><li data-key="footer.links.documentation"><a href="http://docs.atlassian.com/bitbucketserver/docs-056/Bitbucket+Server+documentation?utm_campaign=in-app-help&amp;utm_medium=in-app-help&amp;utm_source=stash" target="_blank">Documentation</a></li><li data-key="footer.links.contact.support"><a href="https://support.atlassian.com/contact" target="_blank">Contact Support</a></li><li data-key="footer.links.jac"><a href="https://jira.atlassian.com/browse/BSERV" target="_blank">Request a feature</a></li><li data-key="footer.links.about"><a href="/stash/about">About</a></li><li data-key="footer.links.contact.atlassian"><a href="http://www.atlassian.com/company/contact/" target="_blank">Contact Atlassian</a></li></ul><div id="footer-logo"><a href="http://www.atlassian.com/" target="_blank">Atlassian</a></div></section></footer><!-- End #footer --></div><script>require('bitbucket/internal/layout/base/base').onReady(null, "HMC Stash" ); require('bitbucket/internal/widget/keyboard-shortcuts/keyboard-shortcuts').onReady();</script></body></html>)


    Could you please help me understanding what is the proper usage of the Jenkinsfile (notifyBitbucket) and/or Groovy Job DSL (stashNotifier) notation to let Jenkins use the user with SSH Credentials?

    Consider that this credentials has been set to have Read/Write access key rights inside both Project and Repository options inside internal Bitbucket project/repository.

    Looking for your kind reply

    Best Regards

    Francesco